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.

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

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

A320882 Primes p such that repeated application of A062028 (add sum of digits) yields two other primes in a row: p, A062028(p) and A062028(A062028(p)) are all prime.

Original entry on oeis.org

11, 59, 101, 149, 167, 257, 277, 293, 367, 419, 479, 547, 617, 727, 839, 1409, 1559, 1579, 1847, 2039, 2129, 2617, 2657, 2837, 3449, 3517, 3539, 3607, 3719, 4217, 4637, 4877, 5689, 5779, 5807, 5861, 6037, 6257, 6761, 7027, 7489, 7517, 8039, 8741, 8969, 9371, 9377, 10667, 10847, 10937, 11257, 11279, 11299, 11657
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

"Iterates" the idea of A048519 (p and A062028(p) are prime), also considered in A048523, A048524, A048525, A048526, A048527. (This is the union of A048524, A048525, A048526, A048527 etc. A048525(1) = 277 = a(7).)

Crossrefs

Subsequence of A048519: p and A062028(p) are prime.
Cf. A047791, A048520, A006378, A107740, A243441 (p and p + Hammingweight(p) are prime), A243442 (analog for p - Hammingweight(p)).
Cf. A048523, ..., A048527, A320878, A320879, A320880: primes starting a chain of length 2, ..., 9 under iterations of A062028(n) = n + digit sum of n.

Programs

  • Maple
    f:= n -> n + convert(convert(n,base,10),`+`):
    filter:= proc(n) local x;
    if not isprime(n) then return false fi;
    x:= f(n);
    isprime(x) and isprime(f(x))
    end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Dec 17 2020
  • PARI
    is_A320882(n,p=n)=isprime(p=A062028(p))&&isprime(A062028(p))&&isprime(n) \\ Putting isprime(n) to the end is more efficient for the frequent case when the terms are already known to be prime.
    forprime(p=1,14999,isprime(q=A062028(p))&&isprime(A062028(q))&&print1(p","))
Showing 1-4 of 4 results.