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.

Showing 1-10 of 10 results.

A253140 Smallest of three consecutive primes in arithmetic progression with common difference 24 and digit sum prime.

Original entry on oeis.org

89, 373, 773, 863, 1279, 2063, 2089, 2399, 2663, 2753, 3299, 4153, 4373, 5879, 6173, 6263, 6779, 7079, 7499, 7853, 9473, 10453, 11399, 12253, 12479, 14699, 16763, 19379, 21163, 21563, 25073, 29363, 32189, 33599, 40063, 41879, 42773, 50053, 50363, 52673, 56453
Offset: 1

Views

Author

K. D. Bajpai, Dec 27 2014

Keywords

Examples

			a(1) = 89: 89 + 24 = 113; 113 + 24 = 137; all three are prime. Their digit sums 8+9 = 17, 1+1+3 = 5 and 1+3+7 = 11 are also prime.
a(2) = 373: 373 + 24 = 397; 397 + 24 = 421; all three are prime. Their digit sums 3+7+3 = 13, 3+9+7 = 19 and 4+2+1 = 7 are also prime.
		

Crossrefs

Programs

  • Mathematica
    A253140 = {}; Do[d = 24; k = Prime[n]; k1 = k+d; k2 = k+2d; If[PrimeQ[k1] && PrimeQ[k2] && PrimeQ[Plus@@IntegerDigits[k]] && PrimeQ[Plus@@IntegerDigits[k1]] && PrimeQ[Plus@@IntegerDigits[k2]], AppendTo[A253140,k]], {n,20000}]; A253140
    tcpQ[n_]:=Module[{a=n+24,b=n+48},AllTrue[{a,b},PrimeQ]&&AllTrue[Total/@ (IntegerDigits/@{n,a,b}),PrimeQ]]; Select[Prime[Range[6000]],tcpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 16 2016 *)

A110028 Primes with a prime number of digits, all of them prime, that add up to a prime.

Original entry on oeis.org

23, 223, 227, 337, 353, 373, 557, 577, 733, 757, 773, 22573, 23327, 25237, 25253, 25523, 27253, 27527, 32233, 32237, 32257, 32323, 32327, 33223, 33353, 33377, 33533, 33773, 35227, 35353, 35533, 35537, 35573, 35753, 37223, 37337, 52237, 52253, 52727, 53353
Offset: 1

Views

Author

Sergio Pimentel, Mar 31 2006

Keywords

Comments

First 7-digit number in this sequence is 2222333.
From Michael De Vlieger, Feb 02 2019: (Start)
First p-digit number in this sequence:
2 23
3 223
5 22573
7 2222333
11 22222222223
13 2222222225323
17 22222222222225237
19 2222222222222223527
23 22222222222222222232723
29 22222222222222222222222222577
31 2222222222222222222222222232257
37 2222222222222222222222222222222235773
...
(End)

Examples

			22573 is a term because 22573 is prime, it has five digits (5 is a prime), all digits (2,3,5,7) are prime, and the sum of the digits is 2+2+5+7+3 = 19, which is also a prime.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) local nn: nn:=convert(n,base,10): if isprime(n) and isprime(nops(nn)) and map(isprime,nn)=[seq(true,i=1..nops(nn))] and isprime(add(nn[j],j=1..nops(nn))) then n fi end: seq(a(k),k=1..60000); # Emeric Deutsch, Apr 02 2006
  • Mathematica
    Select[Prime@ Range@ 6000, And[PrimeQ@ Length@ #, AllTrue[#, PrimeQ], PrimeQ@ Total@ #] &@ IntegerDigits@ # &] (* or *)
    With[{p = {2, 3, 5, 7}}, Table[Select[FromDigits /@ Select[Tuples[p, {q}], PrimeQ@ Total@ # &], PrimeQ], {q, Prime@ Range@ 3}]] // Flatten (* Michael De Vlieger, Feb 02 2019 *)
  • Python
    from sympy import isprime, nextprime
    from itertools import islice, product
    def agen(): # generator of terms
        p = 2
        while True:
            for d in product("2357", repeat=p-1):
                for last in "37":
                    if isprime(sum(map(int, s:="".join(d) + last))):
                        if isprime(t:=int(s)):
                            yield t
            p = nextprime(p)
    print(list(islice(agen(), 40))) # Michael S. Branicky, May 26 2023

A070029 Primes with only prime digits and whose initial, all intermediate and final iterated sums of digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 23, 223, 227, 353, 2333, 2777, 3323, 7727, 27527, 33377, 33773, 35537, 35573, 35753, 37337, 52727, 53777, 55337, 55373, 55733, 57557, 57737, 57773, 73553, 73757, 75227, 75353, 75377, 75533, 75557, 75773, 77573, 222557, 222773
Offset: 1

Views

Author

Rick L. Shepherd, Apr 21 2002

Keywords

Comments

This sequence is the intersection of A062088 and A070027.

Examples

			53777 is a term because 53777 is a prime with only prime digits and 5+3+7+7+7=29, 2+9=11 and 1+1=2 are all prime.
		

Crossrefs

Cf. A070027, A062088 (only first sum of digits is necessarily prime).

Programs

  • Mathematica
    iifpQ[n_]:=AllTrue[NestWhileList[Total[IntegerDigits[#]]&,n,#>9&],PrimeQ]; Select[Prime[Range[20000]],AllTrue[IntegerDigits[#],PrimeQ]&&iifpQ[#]&] (* Harvey P. Dale, Jul 18 2021 *)

A117608 Let p be an element of A110028. Let L(p) be the sorted list of digits of p and let LL be the set of all L(p) with duplicates removed and ordered lexicographically. Then a(n) is the first element of A110028 such that L(a(n))=LL(n).

Original entry on oeis.org

23, 223, 227, 337, 353, 557, 577, 773, 22573, 23327, 25253, 27527, 32233, 33353, 33377, 35353, 35537, 53777, 57557, 75577, 77377, 2222333, 2222533, 2222537, 2227727, 2233337, 2233757, 2235353, 2235557, 2237773, 2277553, 2332333, 2525557, 2572777, 3333773, 3335537, 3335737
Offset: 1

Views

Author

Walter Kehowski, Apr 06 2006

Keywords

Comments

Terms have at least one 3 or at least one 7. - David A. Corneth, May 26 2023

Examples

			a(4)=337 since 337, 373 and 733 all have the same sorted list of digits [3,3,7].
		

Crossrefs

Programs

  • Maple
    a:=proc(b,n) local nn: nn:=convert(n, base, b): if isprime(n) and isprime(nops(nn)) and andmap(isprime,nn) and isprime(convert(nn,`+`)) then n else fi end: L:=[seq(a(10,k), k=1..10^5)]; U:=[]: for z to 1 do A:=L; for x in L do l:=sort(convert(x,base,10)); m:=[selectremove(proc(z) sort(convert(z,base,10))=l end, A)]; if not m[1]=[] then U:=[op(U),min(op(m[1]))]; fi; if m[2]=[] then break else A:=m[2]; fi od od; U;

A158205 Primes with every digit a nonprime and the sum of the digits a prime.

Original entry on oeis.org

11, 41, 61, 89, 101, 191, 199, 401, 409, 449, 461, 601, 641, 661, 809, 881, 911, 919, 991, 1019, 1091, 1109, 1181, 1499, 1619, 1811, 1901, 1949, 4001, 4049, 4111, 4409, 4441, 4481, 4649, 4801, 4861, 4889, 4919, 4999, 6089, 6449, 6481, 6661, 6689, 6841
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 13 2009

Keywords

Comments

Nonprime digits are 0, 1, 4, 6, 8 or 9.

Examples

			11(1+1=2), 41(4+1=5), 61(6+1=7), 89(8+9=17), 101(1+0+1=2), 191(1+9+1=11)
		

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Select[Tuples[{0,1,4,6,8,9},4],PrimeQ[Total[#]]&],PrimeQ]//Flatten (* Harvey P. Dale, Oct 02 2021 *)

Extensions

Entries checked by R. J. Mathar, May 19 2010

A253216 Smallest of four primes in arithmetic progression with common difference 6 and digit sum prime.

Original entry on oeis.org

1091, 15791, 30091, 369991, 421691, 501191, 661091, 1101091, 1539991, 2042591, 2210291, 2542091, 2811191, 3351191, 3512291, 3864691, 4411391, 4675591, 5960791, 5992291, 5998691, 6884191, 6918391, 7516891, 8608591, 8697791, 9297091, 9622891, 9646291, 12013091
Offset: 1

Views

Author

K. D. Bajpai, Dec 29 2014

Keywords

Examples

			a (1) = 1091: 1091 + 6 = 1097; 1097 + 6 = 1103; 1103 + 6 = 1109; all four are prime. Their digit sums 1+0+9+1 = 11; 1+0+9+7 = 17; 1+1+0+3 = 5 and 1+1+0+9 = 11 are also prime.
a(2) = 15791: 15791 + 6 = 15797; 15797 + 6 = 15803; 15803 + 6 = 15809; all four are prime. Their digit sums 1+5+7+9+1 = 23, 1+5+7+9+7 = 29, 1+5+8+0+3 = 17 and 1+5+8+0+9 = 23 are also prime.
		

Crossrefs

Programs

  • Mathematica
    A253216 = {}; Do[d = 6; k = Prime[n]; k1 = k + d; k2 = k + 2d; k3 = k + 3d; If[PrimeQ[k1] && PrimeQ[k2] && PrimeQ[k3] && PrimeQ[Plus @@ IntegerDigits[k]] && PrimeQ[Plus @@ IntegerDigits[k1]] && PrimeQ[Plus @@ IntegerDigits[k2]] && PrimeQ[Plus @@ IntegerDigits[k3]], AppendTo[A253216, k]], {n, 1000000}]; A253216
    prQ[{a_,b_,c_,d_}]:=AllTrue[{b,c,d},PrimeQ]&&AllTrue[Total/@ (IntegerDigits/@ {a,b,c,d}),PrimeQ]; Select[#+{0,6,12,18}& /@Prime[Range[800000]],prQ][[All,1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 26 2018 *)
  • PARI
    for( n=1, 10^6, k=prime(n); k1=k+6; k2=k+12; k3=k+18; if(isprime(k1)&isprime(k2)&isprime(k3) &isprime(eval(Str(sumdigits(k)))) &isprime(eval(Str(sumdigits(k1)))) &isprime(eval(Str(sumdigits(k2)))) &isprime(eval(Str(sumdigits(k3)))), print1(k,", ")))

Extensions

Definition corrected by Harvey P. Dale, May 26 2018

A253232 Smallest of five consecutive primes in arithmetic progression with common difference 90 and equal digit sums.

Original entry on oeis.org

61, 83, 89, 593, 1399, 2063, 2287, 2351, 2441, 3491, 5081, 5171, 5479, 6599, 9497, 12073, 16561, 17569, 21377, 23099, 23189, 28573, 29063, 32143, 36293, 36497, 36587, 39569, 49279, 61291, 62383, 65449, 66373, 71167, 72379, 75347, 81457, 88591, 92377, 94261, 104369
Offset: 1

Views

Author

K. D. Bajpai, Dec 29 2014

Keywords

Comments

90 is the smallest common difference (d) to get a set of five consecutive primes in arithmetic progression {p, p+d, p+2d, p+3d, p+4d} having digit sums equal; for p < prime(10^5).

Examples

			a(1) = 61: 61+90 = 151; 151+90 = 241; 241+90 = 331; 331+90 = 421; all five are prime. Their digit sums 6+1 = 1+5+1 = 2+4+1 = 3+3+1 = 4+2+1 = 7 are all equal.
a(2) = 83: 83+90 = 173; 173+90 = 263; 263+90 = 353; 353+90 = 443; all five are prime. Their digit sums 8+3 = 1+7+3 = 2+6+3 = 3+5+3 = 4+4+3 = 11 are all equal.
		

Crossrefs

Programs

  • Mathematica
    A253232 = {}; Do[d = 90; k = Prime[n]; k1 = k + d; k2 = k + 2 d; k3 = k + 3 d; k4 = k + 4 d; s = Plus @@ IntegerDigits[k]; s1 = Plus @@ IntegerDigits[k1]; s2 = Plus @@ IntegerDigits[k2]; s3 = Plus @@ IntegerDigits[k3]; s4 = Plus @@ IntegerDigits[k4]; If[PrimeQ[k1] && PrimeQ[k2] && PrimeQ[k3] && PrimeQ[k4] && s == s1 && s1 == s2 && s2 == s3 && s3 == s4, AppendTo[A253232, k]], {n, 50000}]; A253232
    cd90Q[p_]:=Module[{q=p+90,r=p+180,s=p+270,t=p+360},AllTrue[{p,q,r,s,t},PrimeQ] && Length[Union[Total/@(IntegerDigits/@{p,q,r,s,t})]]==1]; Select[ Prime[ Range[ 10000]],cd90Q] (* Harvey P. Dale, May 13 2022 *)

A277607 Smallest of four consecutive primes in arithmetic progression with common difference 42 and all digit sums prime.

Original entry on oeis.org

5, 47, 157, 227, 317, 337, 557, 2027, 3037, 3217, 5147, 6047, 7457, 12527, 13757, 14657, 20357, 21017, 23747, 32057, 35027, 47417, 57047, 84137, 115727, 125627, 127247, 136337, 147137, 149027, 212057, 219937, 225257, 230017, 240047, 242357, 264137, 284117, 304127
Offset: 1

Views

Author

K. D. Bajpai, Oct 31 2016

Keywords

Examples

			a(1) = 5: 5 + 42 = 47; 47 + 42 = 89; 89 + 42 = 131; all four are prime. Their digit sums 5, 4 + 7 = 11, 8 + 9 = 17 and 1 + 3 + 1 = 5 are also prime.
a(2) = 47: 47 + 42 = 89; 89 + 42 = 131; 131 + 42 = 173; all four are prime. Their digit sums  4 + 7 = 11, 8 + 9 = 17, 1 + 3 + 1 = 5 and 1 + 7 + 3 = 11 are also prime.
		

Crossrefs

Programs

  • Mathematica
    A277607 = {}; Do[d = 42; k = Prime[n]; k1 = k + d; k2 = k + 2 d; k3 = k + 3 d; If[PrimeQ[k1] && PrimeQ[k2] && PrimeQ[k3] && PrimeQ[Plus @@ IntegerDigits[k]] && PrimeQ[Plus @@ IntegerDigits[k1]] && PrimeQ[Plus @@ IntegerDigits[k2]] && PrimeQ[Plus @@ IntegerDigits[k3]], AppendTo[A25, k]], {n, 30000}]; A277607
    FCPQ[n_] := Module[{a = n + 42, b = n + 84, c = n + 126}, AllTrue[{a, b, c}, PrimeQ] && AllTrue[Total /@ (IntegerDigits /@ {n, a, b, c}), PrimeQ]]; Select[Prime[Range[30000]], FCPQ]

A343834 Primes with digits in nondecreasing order, only primes, and with sum of digits also a prime.

Original entry on oeis.org

2, 3, 5, 7, 23, 223, 227, 337, 557, 577, 2333, 2357, 2377, 2557, 2777, 33377, 222337, 222557, 233357, 233777, 235577, 2222333, 2233337, 2235557, 3337777, 3355777, 5555777, 22222223, 22233577, 23333357, 23377777, 25577777, 222222227, 222222557, 222222577
Offset: 1

Views

Author

Mikk Heidemaa, May 01 2021

Keywords

Comments

Intersection of A028864 and A062088.

Crossrefs

Programs

  • Mathematica
    a[p_] := With[{dg = IntegerDigits@p}, PrimeQ@p && OrderedQ@dg && AllTrue[dg, PrimeQ] && PrimeQ@ Total@dg]; Cases[ Range[3*10^7], _?(a@# &)] (* or *)
    upToDigitLen[k_] := Cases[ FromDigits@# & /@ Select[ Flatten[ Table[ Tuples[{2, 3, 5, 7}, {i}], {i, k}], 1], OrderedQ[#] &], _?(PrimeQ@# && PrimeQ@ Total@ IntegerDigits@# &)]; upToDigitLen[10]
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_combinations
    def aupton(terms):
      n, digits, alst = 0, 1, []
      while len(alst) < terms:
        mcstr = "".join(d*digits for d in "2357")
        for mc in multiset_combinations(mcstr, digits):
          sd = sum(int(d) for d in mc)
          if not isprime(sd): continue
          t = int("".join(mc))
          if isprime(t): alst.append(t)
          if len(alst) == terms: break
        else: digits += 1
      return alst
    print(aupton(35)) # Michael S. Branicky, May 01 2021

Extensions

a(33) and beyond from Michael S. Branicky, May 01 2021

A360497 Maximal sequence of primes whose digits are primes and whose digit sum is also a term.

Original entry on oeis.org

2, 3, 5, 7, 23, 223, 2777, 7727, 27527, 33377, 33773, 35537, 35573, 35753, 37337, 52727, 55337, 55373, 55733, 73553, 75227, 75353, 75533, 222557, 222773, 223277, 225257, 225527, 233357, 235337, 235553, 253553, 253733, 277223, 322727, 323537, 332573, 335273
Offset: 1

Views

Author

Hongwei Jin, Feb 09 2023

Keywords

Comments

The sequence is maximal in the sense that a nonempty set of primes cannot be added consistently.

Examples

			2 is a term because it is a prime with prime digits only and its digit sum 2 is also a term.
227 is not a term because the digit sum is 11 which is not a term because it has nonprime digits.
27527 is a term: it is a prime, each digit (2,5,7) is also a prime, and the sum of the digits (2+7+5+2+7 = 23) is also in the sequence.
		

Crossrefs

A subsequence of A062088.

Programs

  • Maple
    R:= {2,3,5,7}: count:= 4:
    S:= [2,3,5,7];
    for d from 2 to 11 do
      S:= map(t -> (10*t+2,10*t+3,10*t+5,10*t+7), S);
      for x in S do
        if member(convert(convert(x,base,10),`+`),R) and isprime(x) then
           R:= R union {x}; count:= count+1;
        fi
      od;
    od:
    sort(convert(R,list)); # Robert Israel, Mar 02 2023
  • Python
    from sympy import isprime
    seq = [2, 3, 5, 7]
    for i in range(9, 10**6, 2):
        s = str(i)
        if set(s) <= set("2357") and sum(map(int, s)) in seq and isprime(i):
            seq.append(i)
    print(seq)
Showing 1-10 of 10 results.