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-4 of 4 results.

A070027 Prime numbers whose initial, all intermediate and final iterated sums of digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 83, 101, 113, 131, 137, 151, 173, 191, 223, 227, 241, 263, 281, 311, 313, 317, 331, 353, 401, 421, 443, 461, 599, 601, 641, 797, 821, 887, 911, 977, 1013, 1019, 1031, 1033, 1051, 1091, 1103, 1109, 1123, 1163, 1181, 1213
Offset: 1

Views

Author

Rick L. Shepherd, Apr 14 2002

Keywords

Comments

Subsequence of A046704; actually, exactly those numbers for which the orbit under A007953 is a subset of A046704. - M. F. Hasler, Jun 28 2009
Supersequences: A046704 is primes p with digit sum s(p) also prime; A207294 is primes p with s(p) and s(s(p)) also prime.
Disjoint sequences: A104213 is primes p with s(p) not prime; A207293 is primes p with s(p) also prime, but not s(s(p)); A213354 is primes p with s(p) and s(s(p)) also prime, but not s(s(s(p))); A213355 is smallest prime p with k-fold digit sum s(s(..s(p)..)) also prime for all k < n, but not for k = n. - Jonathan Sondow, Jun 13 2012

Examples

			599 is a term because 599, 5+9+9 = 23 and 2+3 = 5 are all prime. 2999 is a term because 2999, 2+9+9+9 = 29, 2+9 = 11 and 1+1 = 2 are all prime. See A062802 and A070026 for related comments.
		

Crossrefs

Cf. A070026 (a supersequence), subsequences: A062802, A070028, A070029.

Programs

  • Mathematica
    dspQ[n_] := TrueQ[Union[PrimeQ[NestWhileList[Plus@@IntegerDigits[#] &, n, # > 9 &]]] == {True}]; Select[Prime[Range[200]], dspQ] (* Alonso del Arte, Aug 17 2011 *)
    isdpQ[n_]:=AllTrue[Rest[NestWhileList[Total[IntegerDigits[#]]&,n,#>9&]],PrimeQ]; Select[Prime[Range[300]],isdpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 12 2017 *)
  • PARI
    isA070027(n)={ while(isprime(n), n<9 && return(1); n=vector(#n=eval(Vec(Str(n))),i,1)*n~)} \\ M. F. Hasler, Jun 28 2009
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) and (n < 10 or ok(sum(map(int, str(n)))))
    print([k for k in range(2, 1214) if ok(k)]) # Michael S. Branicky, May 22 2025

Formula

Prime p is a term if and only if p < 10 or A007953(p) is a term. - Michael S. Branicky, May 22 2025

A070026 Initial, all intermediate and final iterated sums of digits of n are primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 50, 52, 56, 61, 65, 70, 74, 83, 92, 101, 102, 104, 106, 110, 111, 113, 115, 119, 120, 122, 124, 128, 131, 133, 137, 140, 142, 146, 151, 155, 160, 164, 173, 182, 191, 200, 201, 203, 205, 209, 210, 212, 214, 218
Offset: 1

Views

Author

Rick L. Shepherd, Apr 13 2002

Keywords

Comments

2999 = A062802(4) is the smallest term of this sequence for which the second iterated sum of digits is not the final sum; i.e. the smallest requiring three summations (2+9+9+9=29, 2+9=11, 1+1=2 and all three sums are prime). (The corresponding statement about the very large A062802(5) is not true because a large number of smaller nonprimes of the same digit length also have the digit sum 2999, the least being 29999..., where 333 9's follow the 2.). A062802, a sequence of primes, is a subsequence of this sequence and of A070027.
Additional terms can be generated by finding the next number whose digit sum is a prime already in the sequence. - Felix Fröhlich, Jun 13 2014

Examples

			47 is here because 4+7=11 and 11 is prime while also 1+1=2 and 2 is prime. 39 (in A028835) is not a term: 3+9=12 is not prime - although 1+2=3 is prime. 49 (in A028834) is not a term: 4+9=13 is prime but 1+3=4 is not prime.
		

Crossrefs

Cf. A028834 (Initial sum is prime), A028835 (Final sum is prime), A062802, A070027 (Primes from this sequence).

Extensions

Terms corrected by Felix Fröhlich, Jun 13 2014

A103830 a(1) = 2; a(n+1) = smallest number > a(n) whose sum of digits is a(n).

Original entry on oeis.org

2, 11, 29, 2999
Offset: 1

Views

Author

Zak Seidov, Feb 17 2005

Keywords

Comments

a(5) = 3*10^333-1 = 2999...999 with 333 9's and contains 334 digits.
Surprisingly enough the first four terms are all primes and match those of A062802, but a(5) is divisible by 65033 and is different from A062802(5).
Sequences with other seeds: 3,12,129,399999999999999,...; 4,13,139,4999999999999999,...; 5,14,149,59999999999999999.

Crossrefs

Differs from A062802 starting at a(5).

Formula

For n>=3, a(n) = (a(n-1) mod 9 + 1)*10^floor(a(n-1)/9) - 1. - Max Alekseyev, Aug 13 2015
For n>=3, a(n) = 3*10^b(n) - 1, where b(3)=1 and for n>=4, b(n)=(10^b(n-1)-1)/3. In other words, decimal representation of b(n) is formed by digit 3 repeated b(n-1) times. - Max Alekseyev, Aug 13 2015

A361402 a(1) = 5; a(n+1) is the smallest prime p > a(n) such that digsum(p) = a(n).

Original entry on oeis.org

5, 23, 599, 7899999999999999999999999999999999999999999999999899999999999999999
Offset: 1

Views

Author

Ya-Ping Lu, Mar 10 2023

Keywords

Examples

			a(3) = 599 because 599 is the smallest prime > a(2) whose sum of digits is 5 + 9 + 9 = 23 = a(2).
		

Crossrefs

Showing 1-4 of 4 results.