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: J.W.L. (Jan) Eerland

J.W.L. (Jan) Eerland's wiki page.

J.W.L. (Jan) Eerland has authored 30 sequences. Here are the ten most recent ones:

A383746 Numbers k such that k divides the sum of the digits of k^(3k).

Original entry on oeis.org

1, 2, 3, 6, 9, 11, 18, 38, 43, 87, 126, 670, 1098, 2421, 3588, 4201, 5114, 5877, 5922, 6048, 11799, 46119, 46419, 55098, 55945, 77439, 91541, 129624, 153229, 182402
Offset: 1

Author

J.W.L. (Jan) Eerland, May 08 2025

Keywords

Examples

			2 is a term since the sum of digits of 2^(3*2) is 64, which is divisible by 2.
3 is a term since the sum of digits of 3^(3*3) is 19683, which is divisible by 3.
1098 is a term since the sum of digits of 1098^(3*1098) is 45018, which is divisible by 1098.
		

Crossrefs

Programs

  • Mathematica
    Do[If[Mod[Plus @@ IntegerDigits[n^(3*n)], n] == 0, Print[n]], {n, 1, 10000}]
  • Python
    from gmpy2 import digits, mpz
    def ok(n): return n and sum(map(mpz, digits(n**(3*n))))%n == 0
    print([k for k in range(1100) if ok(k)]) # Michael S. Branicky, May 08 2025

Extensions

a(21)-a(23) and a(28)-a(30) from Michael S. Branicky, May 08 2025

A382666 Smallest k such that 7^(7^n) - k is prime.

Original entry on oeis.org

2, 2, 6, 512, 3918, 48966
Offset: 0

Author

J.W.L. (Jan) Eerland, Apr 08 2025

Keywords

Comments

This is to 7 as A058220 is to 2, A140331 is to 3 and A364454 is to 6.
a(6) > 10000. - Michael S. Branicky, Apr 15 2025

Examples

			a(2) = 6 because 7^(7^2) - 6 = 256923577521058878088611477224235621321601 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=7^(7^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[7^(7^n)-k],Break[]];k++];k],k],{n,0,7}]
    y[n_] := Module[{x = 7^(7^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 7^(7^n)); x - precprime(x-1);
    
  • Python
    from sympy import prevprime
    def a(n):
        base = 7**(7**n)
        return base - prevprime(base)
    # Jakub Buczak, May 04 2025

Extensions

a(5) from Michael S. Branicky, Apr 14 2025

A382898 Beginning with 13, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

13, 151, 227, 2083, 887, 79, 2963, 1579, 6287, 1321, 6719, 54919, 26699, 8647, 4229, 3919, 102161, 42433, 1667, 192193, 11633, 186343, 47339, 3259, 65963, 14293, 29717, 61297, 28493, 231367, 43793, 145021, 566441, 475903, 92381, 80473, 139967, 882061, 72893, 709279, 6053, 114487, 1179389, 204331, 203351, 139831, 396239, 205327, 501173, 951589
Offset: 1

Author

J.W.L. (Jan) Eerland, Apr 08 2025

Keywords

Crossrefs

Cf. A113584 (same for 3), A379761 (same for 7), A380227 (same for 11).

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 13: x:= 13:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # after Robert Israel in A113584
  • Mathematica
    w={13};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]]&&PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],{i,k}];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 13
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 40))) # after Michael S. Branicky in A113584

A380227 Beginning with 11, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

11, 3, 11, 31, 59, 463, 131, 103, 599, 3253, 7649, 439, 12791, 2953, 17321, 16651, 10007, 51787, 4871, 1483, 6857, 15649, 53051, 61441, 84449, 35533, 19913, 39097, 23081, 206527, 44939, 189517, 32369, 106657, 606899, 117703, 222977, 220903, 69779, 12007, 95063, 136471, 43973
Offset: 1

Author

J.W.L. (Jan) Eerland, Jan 17 2025

Keywords

Crossrefs

Cf. A113584 (same for 3), A379761 (same for 7).

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 11: x:= 11:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # after Robert Israel in A113584
  • Mathematica
    w={11};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]]&&PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],{i,k}];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 11
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 40))) # after Michael S. Branicky in A113584

A380010 Beginning with 7, least prime such that concatenation of the first n terms is prime.

Original entry on oeis.org

7, 3, 3, 3, 31, 23, 13, 3, 167, 13, 137, 3, 73, 383, 499, 431, 13, 101, 61, 47, 67, 101, 13, 83, 1237, 107, 97, 467, 499, 677, 1423, 353, 73, 431, 331, 683, 487, 2141, 3, 1753, 1787, 31, 443, 139, 653, 1327, 17, 919, 173, 2851, 137, 547, 557, 5167, 347, 7867, 839, 19, 179, 19
Offset: 1

Author

J.W.L. (Jan) Eerland, Jan 09 2025

Keywords

Programs

  • Mathematica
    w={7};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],k];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, an = "", 7
        while True:
            yield int(an)
            s += digits(an)
            p = 3
            while not is_prime(mpz(s+digits(p))): p = next_prime(p)
            an = p
    print(list(islice(agen(), 50))) # after Michael S. Branicky in A379354

A380011 Beginning with 7, least prime such that the reversal concatenation of the first n terms is prime.

Original entry on oeis.org

7, 3, 3, 13, 3, 2, 13, 47, 43, 47, 37, 41, 109, 41, 139, 149, 109, 263, 73, 563, 163, 41, 19, 797, 61, 107, 31, 821, 43, 149, 37, 953, 211, 89, 547, 353, 337, 167, 67, 239, 1009, 449, 97, 23, 349, 41, 31, 911, 61, 929, 229, 797, 331, 191, 463, 107, 463, 809, 2887, 971
Offset: 1

Author

J.W.L. (Jan) Eerland, Jan 09 2025

Keywords

Comments

"Reverse concatenation" here refers to the decimal concatenation R(a(n)) || R(a(n-1)) || ... || R(a(3)) || R(a(2)) || R(a(1)) where R(k) means "reverse digits of k".

Programs

  • Mathematica
    w={7};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]],Break[]];k++];Prime[k]],k];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        r, an = "", 7
        while True:
            yield int(an)
            r = digits(an)[::-1] + r
            p = 2
            while not is_prime(mpz(digits(p)[::-1]+r)): p = next_prime(p)
            an = p
    print(list(islice(agen(), 50))) # after Michael S. Branicky in A379355

A379761 Beginning with 7, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

7, 3, 3, 31, 389, 1021, 2243, 1831, 5849, 15361, 9887, 3877, 4157, 919, 22637, 14449, 27617, 80221, 5039, 51043, 14009, 126079, 24443, 68311, 49193, 47059, 13049, 253681, 271409, 221227, 138869, 116953, 146297, 21841, 1211549, 322501, 212633, 281791, 216071, 1901749, 38747, 116437
Offset: 1

Author

J.W.L. (Jan) Eerland, Jan 02 2025

Keywords

Examples

			31 is a term because the concatenation of {7,3,3,31} and {13,3,3,7} are respectively 73331 and 13337 which are both prime.
2243 is a term because the concatenation of {7,3,3,31,389,1021,2243} and {3422,1201,983,13,3,3,7} are respectively 7333138910212243 and 3422120198313337 which are both prime.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 7: x:= 7:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # after Robert Israel in A113584
  • Mathematica
    w={7};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]]&&PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],{i,k}];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 7
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jan 02 2025

A379355 Beginning with 3, least prime such that the reversal concatenation of first n terms is prime.

Original entry on oeis.org

3, 2, 2, 13, 2, 13, 59, 31, 263, 73, 23, 31, 449, 31, 59, 313, 2, 3, 211, 317, 31, 449, 241, 887, 349, 911, 853, 887, 313, 173, 1777, 179, 967, 503, 331, 113, 163, 359, 1153, 281, 97, 1823, 13, 23, 1657, 269, 223, 3623, 2017, 233, 61, 1361, 367, 1031, 79, 389, 577, 2963, 1741, 59, 13, 1439, 463, 797
Offset: 1

Author

J.W.L. (Jan) Eerland, Dec 21 2024

Keywords

Comments

"Reverse concatenation" here seems to refer to the decimal concatenation R(a(n)) || R(a(n-1)) || ... || R(a(3)) || R(a(2)) || R(a(1)) where R(k) means "reverse digits of k". - N. J. A. Sloane, Jan 03 2025

Crossrefs

The primes produced are in A379782.

Programs

  • Mathematica
    w = {3};
    Do[k = 1;
      q = Monitor[
        Parallelize[
         While[True,
          If[PrimeQ[
             FromDigits[
              Join @@ IntegerDigits /@
                Reverse[
                 IntegerDigits[
                  FromDigits[
                   Join @@ IntegerDigits /@ Append[w, Prime[k]]]]]]], Break[]]; k++];
         Prime[k]], k];
      w = Append[w, q], {i, 2, 57}];
    w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        r, an = "", 3
        while True:
            yield int(an)
            r = digits(an)[::-1] + r
            p = 2
            while not is_prime(mpz(digits(p)[::-1]+r)): p = next_prime(p)
            an = p
    print(list(islice(agen(), 57))) # Michael S. Branicky, Dec 21 2024

A379354 Beginning with 3, least prime such that concatenation of first n terms is prime.

Original entry on oeis.org

3, 7, 3, 3, 7, 29, 43, 11, 61, 71, 19, 191, 43, 53, 7, 239, 31, 173, 43, 137, 79, 53, 13, 557, 619, 47, 271, 797, 463, 83, 211, 467, 229, 131, 199, 359, 1249, 887, 853, 641, 109, 257, 1153, 1031, 613, 953, 607, 641, 499, 359, 1297, 1031, 2137, 401, 283, 29, 1321, 1499, 547, 83, 397, 2153, 1759, 1277
Offset: 1

Author

J.W.L. (Jan) Eerland, Dec 21 2024

Keywords

Crossrefs

Programs

  • Mathematica
    w = {3};
    Do[k = 1;
      q = Monitor[
        Parallelize[
         While[True,
          If[PrimeQ[FromDigits[
              Join @@ IntegerDigits /@ Append[w, Prime[k]]]], Break[]]; k++];
         Prime[k]], k];
      w = Append[w, q], {i, 2, 57}];
    w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, an = "", 3
        while True:
            yield int(an)
            s += digits(an)
            p = 3
            while not is_prime(mpz(s+digits(p))): p = next_prime(p)
            an = p
    print(list(islice(agen(), 57))) # Michael S. Branicky, Dec 21 2024

A378512 Numbers k such that 6^sigma(k) - k is a prime.

Original entry on oeis.org

1, 7, 13, 77, 395, 2867, 3959, 5023
Offset: 1

Author

J.W.L. (Jan) Eerland, Nov 29 2024

Keywords

Comments

a(9) > 10^5. - Michael S. Branicky, Dec 01 2024

Examples

			7 is in the sequence because 6^sigma(7) - 7 = 6^8 - 7 = 1679609 is prime.
		

Programs

  • Magma
    [n: n in[1..10000] | IsPrime((6^SumOfDivisors(n)) - n)];
    
  • Mathematica
    a[n_] := Select[Range@ n, PrimeQ[6^DivisorSigma[1, #] - #] &]; a[20000]
    DeleteCases[ParallelTable[If[PrimeQ[6^DivisorSigma[1,k]-k],k,n],{k,1,10^4}],n]
  • PARI
    isok(k) = ispseudoprime(6^sigma(k) - k); \\ Michel Marcus, Dec 09 2024