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-7 of 7 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

A243441 Primes p such that p + A000120(p) is also a prime, where A000120 = sum of digits in base 2 = Hamming weight.

Original entry on oeis.org

2, 3, 5, 17, 43, 163, 277, 311, 347, 373, 461, 479, 571, 643, 673, 821, 853, 857, 881, 977, 983, 1013, 1093, 1103, 1117, 1181, 1223, 1297, 1427, 1433, 1439, 1481, 1523, 1607, 1613, 1621, 1823, 1861, 1871, 1873, 2003, 2083, 2281, 2333, 2393, 2417, 2467, 2549
Offset: 1

Views

Author

Anthony Sand, Jun 05 2014

Keywords

Examples

			2 + digitsum(2,base=2) = 2 + digitsum(10) = 2 + 1 = 3, which is prime.
3 + digitsum(11) = 3 + 2 = 5.
5 + digitsum(101) = 5 + 2 = 7.
17 + digitsum(10001) = 17 + 2 = 19.
43 + digitsum(101011) = 43 + 4 = 47.
		

Crossrefs

Cf. A000120, A092391 (n + A000120(n)), A048519 (analog for base 10).
Cf. A243442 (analog for p - A000120(p)).

Programs

  • Mathematica
    Select[Prime@ Range@ 400, PrimeQ[# + Total@ IntegerDigits[#, 2]] &] (* Michael De Vlieger, Nov 06 2018 *)
  • PARI
    lista(lim) = forprime(p=2,lim, if (isprime(p+hammingweight(p)), print1(p, ", "))); \\ Michel Marcus, Jun 10 2014

Extensions

Name edited by M. F. Hasler, Nov 07 2018

A320866 Primes such that p + digitsum(p, base 4) is again a prime.

Original entry on oeis.org

5, 7, 13, 17, 19, 37, 59, 67, 97, 127, 173, 193, 223, 233, 277, 359, 379, 439, 499, 563, 569, 599, 607, 631, 653, 691, 733, 769, 811, 821, 829, 877, 919, 929, 937, 967, 1009, 1019, 1087, 1093, 1163, 1193, 1213, 1223, 1229, 1297, 1319, 1373, 1399, 1423, 1481, 1483, 1559, 1571, 1597, 1613, 1619, 1627, 1657, 1699, 1733, 1777
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for even bases b. See A243441, A320867, A320868 and A048519 for the analog in base 2, 6, 8 and 10, respectively. Also, as in base 10, there are no such primes (except 5 and 7) when + is changed to -, see comment in A243442.

Examples

			5 = 4 + 1 = 11[4] (in base 4), and 5 + 1 + 1 = 7 is again prime.
		

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320867 (analog for base 6), A320868 (analog for base 8).

Programs

  • Mathematica
    Select[Prime[Range[300]],PrimeQ[#+Total[IntegerDigits[#,4]]]&] (* Harvey P. Dale, Feb 06 2020 *)
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,4))&&print1(p","))

A320867 Primes such that p + digitsum(p, base 6) is again a prime.

Original entry on oeis.org

11, 19, 23, 31, 41, 53, 61, 79, 109, 137, 151, 167, 179, 229, 233, 263, 271, 331, 347, 359, 419, 439, 467, 541, 557, 587, 599, 607, 653, 719, 797, 809, 839, 863, 997, 1019, 1049, 1097, 1109, 1237, 1283, 1291, 1301, 1321, 1373, 1427, 1439, 1487, 1523, 1549, 1607, 1621, 1697, 1709, 1733, 1741, 1867
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for an even base b. See A048519, A243441, A320866 and A320868 for the analog in base 10, 2, 4 and 8, respectively. Also, as in base 10, there are no such primes (except 7 and 11) when + is changed to -, see comment in A243442.

Examples

			11 = 6 + 5 = 15[6] (in base 6), and 11 + 1 + 5 = 17 is again prime.
		

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320866 (analog for base 4), A320868 (analog for base 8).

Programs

  • Maple
    filter:= n -> isprime(n) and isprime(n+convert(convert(n,base,6),`+`)):
    select(filter, [seq(i,i=3..2000,2)]); # Robert Israel, Mar 22 2020
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,6))&&print1(p","))

A320868 Primes such that p + digitsum(p, base 8) is again a prime.

Original entry on oeis.org

13, 29, 31, 41, 47, 61, 67, 71, 83, 97, 157, 193, 229, 241, 271, 283, 373, 397, 409, 431, 449, 467, 503, 587, 601, 607, 761, 787, 929, 971, 991, 1039, 1087, 1091, 1163, 1181, 1213, 1217, 1237, 1249, 1289, 1291, 1307, 1423, 1453, 1471, 1511, 1543, 1553, 1559, 1627, 1657, 1741, 1811, 1847, 1867, 1973, 1999
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for an even base b. See A048519, A243441, A320866 and A320867 for the analog in base 10, 2, 4 and 6, respectively. Also, as in base 10, there are no such primes (except 11 and 13) when + is changed to -, see comment in A243442.

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320866 (analog for base 4), A320867 (analog for base 6).

Programs

  • Maple
    digsum:= proc(n,b) convert(convert(n,base,b),`+`) end proc:
    select(p -> isprime(p) and isprime(p+digsum(p,8)), [seq(i,i=3..10000,2)]); # Robert Israel, Nov 07 2018
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,8))&&print1(p","))

A320869 Primes such that p + digitsum(p, base 16) is again a prime.

Original entry on oeis.org

17, 19, 23, 29, 31, 53, 59, 89, 127, 149, 151, 157, 179, 181, 211, 223, 241, 251, 263, 269, 331, 359, 367, 397, 419, 431, 449, 457, 461, 463, 487, 541, 563, 571, 593, 599, 601, 631, 659, 661, 701, 733, 761, 769, 809, 811, 839, 907, 911, 941, 971, 997, 1049, 1087, 1109, 1171, 1201, 1237, 1283, 1289, 1291
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for an even base b. See A048519, A243441, A320866, A320867 and A320868 for the analog in base 10, 2, 4, 6 and 8, respectively. Also, as in base 10, there are no such primes when + is changed to -, see comment in A243442.

Examples

			17 = 16 + 1 = 11[16] (in base 16), and 17 + 1 + 1 = 19 is again prime.
		

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320866 (analog for base 4), A320867 (analog for base 6), A320868 (analog for base 8).

Programs

  • Maple
    digsum:= (n,b) -> convert(convert(n,base,b),`+`):
    select(p -> isprime(p) and isprime(p+digsum(p,16)), [2,seq(i,i=3..1000,2)]); # Robert Israel, Nov 07 2018
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,16))&&print1(p","))

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