cp's OEIS Frontend

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.

User: Daniel Starodubtsev

Daniel Starodubtsev's wiki page.

Daniel Starodubtsev has authored 13 sequences. Here are the ten most recent ones:

A345338 Integers whose Reverse And Add trajectory reaches its first prime after a record number of iterations (at least one iteration must be performed).

Original entry on oeis.org

1, 5, 181, 10031, 1001320
Offset: 1

Author

Daniel Starodubtsev, Jun 14 2021

Keywords

Comments

a(6) > 10^9 (if it exists).
All numbers whose trajectory reaches a multiple of 3 or 11 before reaching a prime will never reach a prime.

Examples

			a(3) = 181 because it takes 3 iterations (181 -> 362 -> 625 -> 1151 (prime)) to reach a prime, which is more than any smaller number.
		

Crossrefs

Cf. A056964.

Programs

  • PARI
    f(n) = my(t=n, c=1); while(!isprime(t+=fromdigits(Vecrev(digits(t)))), if(gcd(t, 33)>1, return(0)); c++); c;
    lista(nn) = my(m); for(k=1, nn, if(f(k)>m, print1(k, ", "); m=f(k))); \\ Jinyuan Wang, Jun 15 2021
    
  • Python
    from sympy import isprime
    def ra(n): s = str(n); return int(s) + int(s[::-1])
    def afind(limit):
        record = 0
        for k in range(limit+1):
            m, i = ra(k), 1
            while not isprime(m) and m%3 != 0 and m%11 != 0: m = ra(m); i += 1
            if isprime(m) and i > record: record = i; print(k, end=", ")
    afind(1234567) # Michael S. Branicky, Jul 03 2021

A335787 Emirps containing only the digits 1 and 3.

Original entry on oeis.org

13, 31, 113, 311, 113131, 131311, 1131131, 1133131, 1133333, 1311311, 1313311, 1331333, 1333313, 3111313, 3131113, 3133331, 3331331, 3333311, 11113111, 11131111, 11311133, 11313311, 11331311, 11333131, 13131133, 13133311, 31111313, 31311113, 33111311, 33113131
Offset: 1

Author

Daniel Starodubtsev, Jun 23 2020

Keywords

Crossrefs

Intersection of A006567 and A032917.
Subsequence of A020451.

Programs

  • Mathematica
    Select[Flatten[Table[FromDigits[#, 10] & /@ Tuples[{1, 3}, n], {n, 8}]], # != (r = IntegerReverse[#]) && PrimeQ[#] && PrimeQ[r] &] (* Amiram Eldar, Jun 23 2020 after Vincenzo Librandi at A032917 *)

A334170 Emirps containing only the digits 1 and 2.

Original entry on oeis.org

111211, 112111, 12122221, 12222121, 1111122121, 1212211111, 11121211121, 11212221121, 12111212111, 12112221211, 111122221121, 111122222111, 111122222221, 111211221221, 111212212211, 111212222111, 111222212111, 111222221111, 112111211221, 112122112211, 112122211121
Offset: 1

Author

Daniel Starodubtsev, Apr 17 2020

Keywords

Crossrefs

Intersection of A007931 and A006567.
Subsequence of A020450.

Programs

  • Mathematica
    Union @ Flatten @ Table[FromDigits /@ Select[Tuples[{1, 2}, n] ,PrimeQ @ (m = FromDigits[#]) && # != (r = Reverse[#]) && PrimeQ @ FromDigits[r] &], {n, 12}] (* Amiram Eldar, Apr 18 2020 *)
    Table[Select[FromDigits/@Tuples[{1,2},n],!PalindromeQ[#]&&AllTrue[ {#,IntegerReverse[ #]},PrimeQ]&],{n,12}]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 08 2020 *)
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p), rd=Vecrev(d)); (vecsort(d,,8) == [1,2]) && isprime(fromdigits(rd)) && (rd != d));
    lista(nn) = {for (n=1, nn, my(vf = vector(n, k, 1)); for (i=1, 2^n-1, my(vpos = select(x->(x==1), Vecrev(binary(i)), 1), nvf = vf); for (i=1, #vpos, nvf[vpos[i]] = 2;); my(x = eval(Str(1, fromdigits(Vecrev(nvf)), 1))); if (isok(x), print1(x, ", "));););} \\ Michel Marcus, Apr 18 2020

A333523 Number of iterations of Reverse And Add needed to reach a number divisible by n (or 0 if such a number is never reached).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 61, 1, 3, 8, 34, 22, 8, 17, 2, 8, 119, 14, 1, 17, 7, 110, 7, 12, 33, 34, 158, 28, 12, 1, 60, 11, 12, 50, 79, 7, 129, 64, 13, 42, 1, 4, 89, 131, 8, 14, 81, 30, 19, 125, 12, 1, 88, 13, 33, 67, 232, 26, 27, 24, 123, 59, 1, 24, 59, 36, 206, 148, 12, 217, 90, 97
Offset: 1

Author

Daniel Starodubtsev, Mar 26 2020

Keywords

Comments

If n is a palindrome > 0, a(n) = 1. See A002113.
a(n) > 0 for n < 10000.

Examples

			a(12) = 3, because 12 takes 3 iterations (12 -> 33 -> 66 -> 132) to become 132, which is divisible by 12.
		

Crossrefs

Programs

  • PARI
    radd(n) = fromdigits(Vecrev(digits(n)))+n; \\ A056964
    a(n) = {my(i=1, k=n, x); while((x=radd(n)) % k, i++; n=x); i;} \\ Michel Marcus, Apr 11 2020

A333475 Numbers k such that S(2^k) is a perfect square, where S(t) is the sum of decimal digits of t.

Original entry on oeis.org

0, 2, 16, 22, 36, 78, 104, 110, 118, 130, 176, 186, 194, 200, 216, 240, 270, 276, 320, 358, 364, 376, 440, 558, 576, 602, 608, 612, 614, 620, 630, 700, 872, 884, 894, 918, 972, 1144, 1174, 1192, 1216, 1536, 1566, 1610, 1658, 1798, 1882, 2000, 2312, 2630, 2928, 3042, 3540, 3648, 3744, 3750, 3774
Offset: 1

Author

Daniel Starodubtsev, Mar 23 2020

Keywords

Comments

Numbers k such that A000079(k) is in A028839.
All terms are even. - Robert Israel, Mar 24 2020

Examples

			16 is in the sequence, because S(2^16) = S(65536) = 25 is a perfect square.
		

Crossrefs

Programs

  • Maple
    sd:= n -> convert(convert(n,base,10),`+`):
    select(t -> issqr(sd(2^t)), [$0..10000]); # Robert Israel, Mar 24 2020
  • PARI
    isok(k) = issquare(sumdigits(2^k)); \\ Michel Marcus, Mar 23 2020

A333474 Numbers k such that 2^k + 1 is divisible by the sum of its decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 9, 98, 135, 200, 665, 1782, 4230, 4521, 6815, 17010, 19635, 30338, 31365, 35427, 49555, 96619, 102897, 157850, 193734, 273050, 393225, 449217, 477333, 483310, 493350, 534465, 661815, 918918, 947925, 1050858, 1114690, 1134945, 1204686, 1350990, 1428105
Offset: 1

Author

Daniel Starodubtsev, Mar 23 2020

Keywords

Comments

Numbers k such that A000051(k) is in A005349.

Examples

			9 is in the sequence, because 2^9 + 1 = 513 is divisible by 5 + 1 + 3.
		

Crossrefs

Programs

  • PARI
    isok(k) = my(x=2^k+1); !(x % sumdigits(x)); \\ Michel Marcus, Mar 23 2020
  • Python
    print([i for i in range(5000) if (2**i+1)%sum([int(i) for i in str(2**i+1)]) == 0])
    

Extensions

More terms from Giovanni Resta, Mar 23 2020

A309527 Numbers k such that 6^k + 17 is prime.

Original entry on oeis.org

1, 2, 3, 5, 8, 10, 19, 27, 79, 198, 565, 787, 2183, 3811, 4748, 6210, 7887, 8965, 13303, 20125, 23433, 28797
Offset: 1

Author

Daniel Starodubtsev, Aug 06 2019

Keywords

Comments

a(20) > 14000. - Daniel Starodubtsev, Apr 17 2020

Examples

			3 is in the sequence because 6^3 + 17 = 233, which is prime.
		

Programs

  • PARI
    lista(nn)=for(k=0,nn,if(ispseudoprime(6^k+17),print1(k", ")))

Extensions

a(17)-a(18) from Daniel Starodubtsev, Mar 16 2020
a(19) from Daniel Starodubtsev, Apr 17 2020
a(20)-a(22) from Michael S. Branicky, Mar 14 2023

A309726 Numbers k such that k^2 - 12 is prime.

Original entry on oeis.org

5, 7, 11, 13, 17, 19, 25, 29, 35, 41, 49, 53, 59, 61, 79, 85, 91, 95, 97, 103, 107, 113, 119, 121, 137, 139, 145, 149, 163, 169, 173, 179, 181, 185, 191, 205, 209, 227, 233, 235, 245, 251
Offset: 1

Author

Daniel Starodubtsev, Aug 14 2019

Keywords

Comments

All terms are odd and not divisible by 3.

Examples

			11 is in the sequence because 11^2 - 12 = 109, which is prime.
		

Programs

  • Mathematica
    Select[Range[5,301,2],PrimeQ[#^2-12]&] (* Harvey P. Dale, Dec 23 2019 *)
  • PARI
    select(n->isprime(n^2-12), [1..1000]) \\ Andrew Howroyd, Aug 14 2019

Formula

If A056927(k) = 12, then k is a term. - A.H.M. Smeets, Aug 15 2019

A309489 Numbers k such that the sum of digits in odd places is equal to the sum of digits in even places in k!.

Original entry on oeis.org

11, 18, 20, 25, 27, 28, 32, 35, 41, 43, 51, 57, 60, 68, 72, 74, 80, 102, 105, 107, 113, 121, 122, 138, 140, 145, 156, 161, 166, 171, 228, 233, 245, 282, 301, 307, 308, 311, 315, 329, 333, 335, 340, 347, 349, 351, 353, 366, 386, 412, 420, 454, 469, 478
Offset: 1

Author

Daniel Starodubtsev, Aug 04 2019

Keywords

Comments

Numbers k such that A000142(k) is a term of A135499. - Michel Marcus, Aug 04 2019

Crossrefs

Cf. A000142 (n!), A135499.

Programs

  • Mathematica
    aQ[n_] := Total[(d = IntegerDigits[n!])[[1;;-1;;2]]] == Total[d[[2;;-1;;2]]]; Select[Range[500], aQ] (* Amiram Eldar, Aug 04 2019 *)
    sdoeQ[n_]:=With[{nf=IntegerDigits[n!]},Total[Take[nf,{1,-1,2}]]==Total[Take[nf,{2,-1,2}]]]; Select[Range[500],sdoeQ] (* Harvey P. Dale, Jun 04 2025 *)
  • PARI
    isok(k) = {my(d = digits(k!), so=0, se=0); for (i=1, #d, if (i%2, so += d[i], se += d[i])); so == se; } \\ Michel Marcus, Aug 04 2019
    
  • Python
    def c(n): s = str(n); return sum(map(int, s[::2])) == sum(map(int, s[1::2]))
    def afind(limit):
        k, factk = 1, 1
        while k <= limit:
            if c(factk): print(k, end=", ")
            k += 1; factk *= k
    afind(500) # Michael S. Branicky, Nov 18 2021

A309393 Let f(n) be equal to n + S(n) + S(S(n)) ... + S(S(S..(n))), where the last term is less than 10 and S(n) is the sum of digits. This is the sequence of numbers k such that the equation f(x) = k has a record number of solutions.

Original entry on oeis.org

1, 30, 66, 204, 819, 70032, 3000000000096
Offset: 1

Author

Daniel Starodubtsev, Jul 28 2019

Keywords

Comments

Conjecture from Daniel Starodubtsev and Dmitry Petukhov, Nov 19 2019: (Start)
a(8) = 20000000000000046;
a(9) = 8900000000000000000000127. (End)

Examples

			a(4) = 204, because 204 = f(179) = f(185) = f(191) = f(201), which has more solutions than any smaller number.
		

Crossrefs

Programs

  • Mathematica
    T = 0*Range[10^5]; f[n_] := Block[{x=n, s=n}, While[x >= 10, x = Plus@@ IntegerDigits[x]; s += x]; s]; Do[v = f[i]; If[v <= 10^5, T[[v]]++], {i, 10^5}]; Flatten[Position[T, #, 1, 1] & /@ Range[6]] (* Giovanni Resta, Jul 30 2019 *)
  • PARI
    f(n) = {s=n;m=n;while(sumdigits(s)>9,s=sumdigits(s);m+=s);if(n<10,m=0);m+sumdigits(s);}
    g(n) = sum(k=1,n,f(k)==n);
    lista(NN) = {x=1;print1(1);for(n=2,NN,if(g(n)>x,x=g(n);print1(", ",n)))} \\ Jinyuan Wang, Jul 31 2019

Extensions

a(7) from Bert Dobbelaere, Aug 15 2019