A036237 Duplicate of A015948.
1, 2, 5, 4, 7, 10, 15, 8, 11, 14, 13, 28, 21, 78, 17, 16, 19, 22, 49, 42, 23, 26, 1577, 40
Offset: 0
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
n = 0: 2^1 mod 1 = 0, a(0) = 1; n = 1: 2^k mod k = 1, no such k exists, so a(1) = 0; n = 2: 2^3 mod 3 = 2, a(2) = 3; n = 3: 2^4700063497 mod 4700063497 = 3, a(3) = 4700063497.
a = Table[0, {75} ]; Do[ b = PowerMod[2, n, n]; If[b < 76 && a[[b]] == 0, a[[b]] = n], {n, 1, 5*10^9} ]; a (* Second program: *) t = Table[0, {1000} ]; k = 1; While[ k < 6500000000, b = PowerMod[2, k, k]; If[b < 1001 && t[[b]] == 0, t[[b]] = k]; k++ ]; t nk[n_] := Module[ {k}, k = 1; While[PowerMod[2, k, k] != n, k++]; k] Join[{1, 0}, Table[nk[i], {i, 2, 46}]] (* Robert Price, Oct 11 2018 *)
a(n)=if(n==1,return(0));my(k=n);while(lift(Mod(2,k)^k)!=n,k++);k \\ Charles R Greathouse IV, Oct 12 2011
Comments