Introduzione / Contesto In una recente discussione nella chat crittografica sono stato sfidato a discutere / aiutare con il test di primalità di Fermat e i numeri di Carmichael. Questo test si basa sulla premessa che a^(p-1) mod p==1sarà sempre valida per i numeri primi p, ma non sempre per …
A differenza di molti linguaggi, Python valuta a<b<cin quanto sarebbe stato fatto nel campo della matematica, in realtà a confronto i tre numeri, al contrario di confrontare il booleano a<ba c. Il modo corretto di scrivere questo in C (e molti altri) sarebbe a<b && b<c. In questa sfida, il …
Dato un numero intero n, stampan * reversed(n) reversed(n)è il numero che ottieni quando hai reversele cifre di n. reverse(512) = 215 reverse(1) = 1 reverse(101) = 101 >>>>>>>> func(5) = 5*5 = 25 func(12) = 12*21 = 252 func(11) = 11*11 = 121 func(659) = 659*956 = 630004 Vince …
L'obiettivo di questa sfida è utilizzare il metodo di Eulero per approssimare la soluzione di un'equazione differenziale della forma f (n) (x) = c. † L'ingresso sarà una lista di interi in cui il n esimo valore rappresenta il valore di f (n) (0). Il primo numero intero è f …
SPECIFICHE Date le mvariabili, crea ogni combinazione fino all'ordine n. Per esempio, L'output della mappatura di due variabili ( ae b) da ordinare 1sarebbe: un' B ab L'output della mappatura di due variabili ( ae b) da ordinare 2sarebbe: un' a 2 B b 2 ab a 2 b ab …
Questa domanda è scritta perché "Thing Explainer" è divertente da leggere e mi ha dato un'idea. Scrivi "cose che fanno fare al computer cose" che legge / prende un insieme di lettere, numeri e cose del genere "#%|?e ritorna True / 1se tutte le parole fanno parte di questo insieme …
Definizione a(1) = 1 a(2) = 2 a(n)è il numero più piccolo k>a(n-1)che evita qualsiasi progressione aritmetica a 3 termini in a(1), a(2), ..., a(n-1), k. In altre parole, a(n)il numero più piccolo è k>a(n-1)tale che non esiste x, ydove 0<x<y<ne a(y)-a(x) = k-a(y). Esempio risolto Per n=5: abbiamo a(1), …
Quando faccio sollevamento pesi, voglio fare un peso specifico attaccando più piastre a una barra. Ho i seguenti piatti: 6 piatti da 1 kg ciascuno 6 piatti da 2,5 kg ciascuno 6 piatti da 5 kg ciascuno 6 piatti da 10 kg ciascuno La barra stessa pesa 10 kg. È …
Questo è simile alla semplificazione delle frazioni, ma con Date! L'input del programma deve essere nel formato mm/dd Ad esempio 3/4 //March 4 12/15 //December 15 1/1 // January 1 Partiamo dal presupposto che l'input sarà valido in modo che i mesi contengano questi numeri di giorni: January 31 February …
Negli esempi che seguono, Ae Bsarà di 2-by-2 matrici e le matrici sono uno indicizzate. Un prodotto Kronecker ha le seguenti proprietà: A⊗B = A(1,1)*B A(1,2)*B A(2,1)*B A(2,2)*B = A(1,1)*B(1,1) A(1,1)*B(1,2) A(1,2)*B(1,1) A(1,2)*B(1,2) A(1,1)*B(2,1) A(1,1)*B(2,2) A(1,2)*B(2,1) A(1,2)*B(2,2) A(2,1)*B(1,1) A(2,1)*B(1,2) A(2,2)*B(1,1) A(2,2)*B(1,2) A(2,2)*B(2,1) A(2,2)*B(1,2) A(2,2)*B(2,1) A(2,2)*B(2,2) Una somma di Kronecker ha …
Un numero di nascita norvegese è composto da 11 cifre, composte nel modo seguente: DDMMYYiiikk DD è il giorno (dal 01-31) MM è il mese (dal 01-12) YYè l'anno (dalle 00-99). Non è differenziato tra il 1900 e il 2000 iii è il "numero individuale" kk sono due cifre di …
Crea un programma che risolva un'espressione matematica usando gli elementi dai lati alternati dell'espressione. Il modo in cui è fatto è, invece di leggere da sinistra a destra, leggi il primo carattere, poi l'ultimo, poi il secondo, quindi il secondo all'ultimo, ecc. Questo ti darà una nuova espressione che devi …
Rilevanti collegamenti qui e qui , ma ecco la versione breve: Hai un input di due numeri interi ae btra infinito negativo e infinito (anche se se necessario, posso limitare l'intervallo, ma la funzione deve comunque accettare input negativi). Definizione del simbolo di Kronecker È necessario restituire il simbolo Kronecker …
sfondo In questa sfida, una rappresentazione baseb di un numero intero nè un'espressione di nuna somma di poteri di b, in cui ogni termine si verifica nella maggior parte dei b-1casi. Ad esempio, la 4rappresentazione base di 2015è 4^5 + 3*4^4 + 3*4^3 + 4^2 + 3*4 + 3 Ora, …
Devi prendere 2 input di stringa e generare la somma di queste due stringhe senza convertirle in int o utilizzare qualsiasi tipo di dato numerico. ex. string one = "123"; string two = "456"; string sum = "579"; Supponiamo che le stringhe non siano più grandi di 10 cifre. Questo …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.