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

A048519 Prime plus its digit sum equals a prime.

Original entry on oeis.org

11, 13, 19, 37, 53, 59, 71, 73, 97, 101, 103, 127, 149, 163, 167, 181, 233, 257, 271, 277, 293, 307, 367, 383, 389, 419, 431, 433, 479, 499, 509, 547, 563, 587, 617, 631, 701, 727, 743, 787, 811, 839, 857, 859, 947, 1009, 1049, 1061, 1087, 1153, 1171
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Comments

For any prime p, p +- digitsum(p, base b) can't be prime unless the base b is even, since in an odd base, an odd number always has an odd digit sum (powers of b are congruent to b (mod 2)), so p +- digitsum(p, base b) is even for odd b. This sequence is for b = 10 (where "-" is also excluded, see comment in A243442), see A243441 for b = 2. - M. F. Hasler, Nov 06 2018
See subsequence A048523 for primes which only once give another prime under iteration of A062028, and A048524 .. A048527, A320878 .. A320880 for primes starting longer chains. See A090009 for their initial terms, starting the earliest chain of given length. - M. F. Hasler, Nov 09 2018

Examples

			a(9) = prime 97 because 97 + sum-of-digits(97) = 97 + 16 = 113 also a prime.
		

Crossrefs

Cf. A007953 (digit sum), A062028 (n + digit sum of n), A047791 (A062028(n) is prime), A048520.

Programs

  • Haskell
    a048519 n = a048519_list !! (n-1)
    a048519_list = map a000040 $ filter ((== 1) . a010051' . a065073) [1..]
    -- Reinhard Zumkeller, Sep 27 2014
    
  • Magma
    [p: p in PrimesUpTo(1200) | IsPrime(q) where q is p+&+Intseq(p)]; // Vincenzo Librandi, Jan 30 2018
  • Maple
    select(n -> isprime(n) and isprime(n + convert(convert(n,base,10),`+`)), [$1..10^4]); # Robert Israel, Aug 10 2014
  • Mathematica
    Select[Prime[Range[500]],PrimeQ[#+Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 03 2011 *)
  • PARI
    select( is(p)=isprime(p+sumdigits(p))&&isprime(p), primes([0,2000])) \\ M. F. Hasler, Aug 08 2014, edited Nov 09 2018
    

Formula

Primes in A047791, i.e., intersection of A047791 and A000040. - M. F. Hasler, Nov 08 2018

A048523 Primes for which only one iteration of 'Prime plus its digit sum equals a prime' is possible.

Original entry on oeis.org

13, 19, 37, 53, 71, 73, 97, 103, 127, 163, 181, 233, 271, 307, 383, 389, 431, 433, 499, 509, 563, 587, 631, 701, 743, 787, 811, 857, 859, 947, 1009, 1049, 1061, 1087, 1153, 1171, 1223, 1283, 1423, 1483, 1489, 1553, 1597, 1601, 1607, 1733, 1801, 1861, 1867
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Comments

Sequence A048519 lists the primes for which at least (rather than exactly) one iteration of A062028 is "possible". See A048524 .. A048527 and A320878 .. A320880 for further subsequences, and A090009 for the list of their initial terms, starting chains of length >= 3 .. 9. - M. F. Hasler, Nov 09 2018

Examples

			prime 1999 -> 1999 + (1+9+9+9) = prime 2027 -> next iteration yields composite 2038.
		

Crossrefs

Programs

  • Mathematica
    ppd1Q[n_]:=PrimeQ[Rest[NestList[#+Total[IntegerDigits[#]]&,n,2]]] == {True,False}; Select[Prime[Range[300]],ppd1Q] (* Harvey P. Dale, Nov 10 2011 *)

A320878 Primes such that iteration of A062028 (n + its digit sum) yields 6 primes in a row.

Original entry on oeis.org

286330897, 286330943, 388098901, 955201943, 1776186851, 1854778853, 2559495863, 2647782901, 3517793911, 3628857863, 3866728909, 3974453911, 4167637819, 4269837799, 5083007887, 5362197829, 5642510933, 6034811933, 8180784851, 8214319903
Offset: 1

Views

Author

Zak Seidov and M. F. Hasler, Nov 08 2018

Keywords

Comments

In contrast to A048523, ..., A048527, this definition uses "at least" for the number of successive primes. This allows easier computation of subsequences of terms which yield even more primes in a row.
One can nonetheless compute the terms of this sequence by considering possible pre-images under A062028 of terms of A048527. This gives the terms which yield exactly 6 primes in a row (i.e., A320878 \ A320879), and one has to take the union with further iterates of this procedure (which successively yields A320879 \ A320880, etc).

Crossrefs

Cf. A062028 (n + digit sum of n), A047791 (A062028(n) is prime), A048519 (primes among these).
a(1) = A090009(7) = start of first chain of 7 primes under iteration of A062028.
Cf. A230093 (number of m s.th. m + (sum of digits of m) = n) and references there.

Programs

  • PARI
    is_A320878(n,p=n)={for(i=1,6, isprime(p=A062028(p))||return);isprime(n)}
    forprime(p=286e6,,is_A320878(p)&& print1(p","))
    /* much faster, using the precomputed array A048527, as follows: */
    PP(n)=select(p->p+sumdigits(p)==n,primes([n-9*#digits(n),n-2])) \\ Returns list of prime predecessors for A062028. (PP(n) nonempty <=> n in A320881.)
    A320878=[]; my(S=A048527); while(#S=Set(concat(apply(PP,S))), A320878=setunion(A320878,S)) \\ Yields 211 terms from A048527[1..3000]

Formula

Numbers n in A048519 for which A062028(n) is in A048527, form the subset A320878 \ A320879.

A320880 Primes such that iteration of A062028 (n + its digit sum) yields 8 primes in a row.

Original entry on oeis.org

56676324799, 373169411809, 2121959132809, 10180781225809, 14328311692789, 17429111275789, 32594135422789, 34327062247789, 39262151325799, 57404320087789, 60760513291789, 63116080460809, 66105224572789, 92054642332789, 98606700040789
Offset: 1

Views

Author

Zak Seidov and M. F. Hasler, Nov 08 2018

Keywords

Comments

Term a(1) is immediate to find from the nearly equal terms A320879(7..8); terms a(2..9) were found by G. Resta as answer to Rivera's Puzzle 163, cf. link.

Crossrefs

Cf. A047791, A048519, A062028 (n + digit sum of n).
Subsequence of A320879 which is subsequence of A320878.
a(1) = A090009(9) = start of first chain of 9 primes under iteration of A062028.

Programs

Formula

A320880 = { n in A320879 | A062028(n) in A320879 }.

Extensions

a(10)-a(15) from Lars Blomberg, Feb 10 2019

A320879 Primes such that iteration of A062028 (n + its digit sum) yields 7 primes in a row.

Original entry on oeis.org

286330897, 10858338851, 12869802851, 15845166851, 29837412851, 45480846799, 56676324799, 56676324863, 68105187851, 73915118861, 114737845853, 129282912851, 154648223809, 155738371853, 207036953861, 271077075851, 358515148853, 373169411809, 373169411861, 395705343799
Offset: 1

Views

Author

Zak Seidov and M. F. Hasler, Nov 08 2018

Keywords

Comments

The first 15 terms are immediately calculated from A320878(1..200) using the formula.

Crossrefs

Cf. A047791, A048519, A062028 (n + digit sum of n).
a(1) = A090009(8) = start of first chain of 8 primes under iteration of A062028.
Subsequence of A320878; A320880 is a subsequence.

Programs

Formula

A320879 = { n in A320878 | A062028(n) in A320878 } = { n = A320878(k) | A062028(n) = A320878(k+1) }.

Extensions

a(16)-a(20) from Lars Blomberg, Feb 10 2019

A235680 The smallest first term of a sequence of n primes such that, after the first, each is equal to the previous prime plus the sum of all of its digits, plus the product of all of its nonzero digits.

Original entry on oeis.org

2, 191, 163, 151, 127, 1644997, 36778597, 935715673, 50682890749, 16390560362269, 63334172492839
Offset: 1

Views

Author

Carlos Rivera, Jan 13 2014

Keywords

Comments

The following term produced in each sequence after the n-th is necessarily a composite integer.

Examples

			Example for n=8: a(8)=935715673 because after it the seven primes are 936311069, 936337351, 936490481, 936677149, 938391809, 938811763 and 939029537, with 936311069 = 935715673 + 9*3*5*7*1*5*6*7*3+(9+3+5+7+1+5+6+7+3) and so on...
		

Crossrefs

Extensions

a(9) from Giovanni Resta, Jan 13 2014
a(10)-a(11) from Giovanni Resta, Feb 22 2014

A225544 a(n) begins the earliest chain of exactly n distinct primes such that any term in the chain equals the previous term increased by the product of its digits.

Original entry on oeis.org

2, 29, 23, 347, 293, 239, 57487, 486193, 1725121513, 1221261395831, 28549657193411
Offset: 1

Views

Author

Giovanni Resta, May 10 2013

Keywords

Comments

A chain ends either at a composite number, or at a prime which contains a zero, since the subsequent primes in the chain are identical.

Examples

			23 starts the earliest chain of length 3, since 23+2*3 = 29, 29+2*9 = 47 and 47+4*7 = 75, where the first 3 terms are distinct and prime, so a(3) = 23. The last distinct term in the chain starting at 1725121513 is the prime 1725980623 which contains a zero and thus generates itself.
		

Crossrefs

Programs

  • Mathematica
    seq = 0*Range[8]; p = 2; While[p < 500000, v = Length@ NestWhileList[# + Times @@ IntegerDigits@# &, p, PrimeQ@#2 && #1 != #2 &, 2] - 1; If[ seq[[v]] == 0, seq[[v]] = p]; p = NextPrime@p]; seq

A376693 a(n) is the first k such that if x(1) = k and x(i+1) = A062028(x(i)), x(1) to x(n) are all semiprimes but x(n+1) is not.

Original entry on oeis.org

1, 4, 15, 22, 39, 33, 291, 23174, 90137, 119135, 1641362, 1641337, 7113362, 471779113
Offset: 0

Views

Author

Robert Israel, Oct 01 2024

Keywords

Examples

			a(4) = 39 because 39 = 3 * 13 is a semiprime, A062028(39) = 39 + 3 + 9 = 51 = 3 * 17 is a semiprime, A062028(51) = 51 + 5 + 1 = 57 = 3 * 19 is a semiprime, A062028(57) = 57 + 5 + 7 = 69 = 3 * 23 is a semiprime, but A062028(69) = 69 + 6 + 9 = 84 = 2^2 * 3 * 7 is not a semiprime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x,i;
    x:= n;
    for i from 0 do
      if numtheory:-bigomega(x) <> 2 then return i fi;
      x:= x + convert(convert(x,base,10),`+`);
    od
    end proc:
    V:= Array(0..12): count:= 0:
    for i from 1 while count < 13 do
      v:= f(i);
      if v <= 12 and V[v] = 0 then V[v]:= i; count:= count+1 fi
    od:
    convert(V,list);
  • PARI
    a(n) = if(n==0, return(1)); for(k=1, oo, if(bigomega(k) == 2, my(c=1, t=k+sumdigits(k)); while(bigomega(t) == 2, c += 1; t += sumdigits(t)); if(c == n, return(k)))); \\ Daniel Suteu, Nov 03 2024

Extensions

a(13) from Daniel Suteu, Nov 03 2024
Showing 1-8 of 8 results.