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 28 results. Next

A356570 a(n) is the first prime that starts a sequence of exactly n consecutive primes that are in A048519.

Original entry on oeis.org

19, 11, 97, 72461, 346373, 2587093, 1534359019, 1010782220887
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 12 2022

Keywords

Comments

a(n) = prime(k) for the least possible k such that prime(i) for k <= i < k+n has the property that it plus its digit sum is prime, but prime(k-1) and prime(k+n) do not have the property.

Examples

			a(3) = 97 because 97, 101, 103 are 3 consecutive primes with 97+9+7 = 113, 101+1+0+1 = 103, 103+1+0+3=107, all prime, but the prime before 97 is 89 and the prime after 103 is 107, and 89+8+9 = 106 and 107+1+0+7 = 115 are not prime; 97 is the least prime for which this works.
		

Crossrefs

Cf. A048519.

Programs

  • Maple
    N:= 6: # for a(1)..a(N)
    V:= Vector(N): count:= 0:
    p:= 2: s:= 0:
    while count < N do
      p:= nextprime(p)
      if isprime(p+convert(convert(p,base,10),`+`)) then
      if s = 0 then q:= p fi;
      s:= s+1
    else
      if s >= 1 and s <= N and V[s] = 0 then
        V[s]:= q; count:= count+1
      fi;
      s:= 0
    fi
    od:
    convert(V,list);
  • Mathematica
    seq[len_, pmax_] := Module[{s = Table[0, {len}], v = {}, p = 2, c = 0, pfirst = 2, i}, While[c < len && p < pmax, If[PrimeQ[p + Plus @@ IntegerDigits[p]], AppendTo[v, p]; If[pfirst == 0, pfirst = p], i = Length[v]; v = {}; If[0 < i <= len && s[[i]] == 0, s[[i]] = pfirst]; pfirst = 0]; p = NextPrime[p]]; s]; seq[6, 10^7] (* Amiram Eldar, Aug 14 2022 *)

Extensions

a(8) from Amiram Eldar, Aug 15 2022

A048520 Primes expressible as the sum of a prime plus its digit sum.

Original entry on oeis.org

13, 17, 29, 47, 61, 73, 79, 83, 103, 107, 113, 137, 163, 173, 181, 191, 241, 271, 281, 293, 307, 317, 383, 397, 409, 433, 439, 443, 499, 521, 523, 563, 577, 607, 631, 641, 709, 743, 757, 809, 821, 859, 877, 881, 967, 1019, 1063, 1069, 1103, 1163, 1181
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			a(15) = 181 which is 167 + (1+6+7).
		

Crossrefs

Programs

  • Mathematica
    Sort[Select[Table[p=Prime[n];p+Total[IntegerDigits[p]],{n,195}],PrimeQ]] (* Jayanta Basu, May 03 2013 *)
    Select[#+Total[IntegerDigits[#]]&/@Prime[Range[200]],PrimeQ]//Sort (* Harvey P. Dale, Sep 02 2023 *)
  • PARI
    is_A048520(n)=#select(p->p+sumdigits(p)==n,primes([n-9*#digits(n),n-2]))&&isprime(n) \\ M. F. Hasler, Nov 08 2018

Extensions

Offset corrected to 1 by M. F. Hasler, Nov 08 2018

A090009 Begins the earliest length-n chain of primes such that any term in the chain equals the previous term increased by the sum of its digits.

Original entry on oeis.org

2, 11, 11, 277, 37783, 516493, 286330897, 286330897, 56676324799
Offset: 1

Views

Author

Joseph L. Pe, Jan 27 2004

Keywords

Comments

From the second term on, subsequence of A[2] := A048519. Due to the "exclusive" definition of this sequence, A048523(1) > a(2), but for k >= 3, a(k) = A[k](1) for A[3..9] = A048524 .. A048527, A320878 .. A320880. - M. F. Hasler, Nov 09 2018

Examples

			11 begins the earliest chain 11, 13, 17 of three primes such that any term in the chain equals the previous term increased by the sum of its digits, viz., 13 = 11 + 2, 17 = 13 + 4. Hence a(3) = 11.
		

Crossrefs

Cf. A047791, A048519, A062028 (n + digit sum of n).

Programs

Extensions

a(7)-a(8) from Donovan Johnson, Jan 08 2013
a(9) from Giovanni Resta, Jan 14 2013

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

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 *)

A048527 Primes for which only five iterations of 'Prime plus its digit sum equals a prime' are possible.

Original entry on oeis.org

516493, 1056493, 1427383, 1885943, 3166183, 3805183, 4241593, 6621283, 7646953, 12912283, 17987839, 32106493, 107152093, 120224773, 131144473, 133210873, 139388891, 142782877, 150326173, 155382923, 177865819, 184081943, 227795839, 242376877, 264174877
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			516493 -> 516521 -> 516541 -> 516563 -> 516589 -> 516623 -> next iteration yields a composite.
		

Crossrefs

Cf. A047791, A048519, A062028 (n + digit sum of n).

Programs

Extensions

Offset changed to 1 and a(15)-a(24) from Lars Blomberg, Dec 04 2013

A107288 Primes whose digit sum is a square.

Original entry on oeis.org

13, 31, 79, 97, 103, 211, 277, 349, 367, 439, 457, 547, 619, 673, 691, 709, 727, 853, 907, 997, 1021, 1069, 1087, 1201, 1249, 1429, 1447, 1483, 1609, 1627, 1663, 1699, 1753, 1789, 1861, 1879, 1933, 1951, 1987, 2011, 2239, 2293, 2347, 2383, 2437, 2473, 2617, 2671
Offset: 1

Views

Author

Zak Seidov, May 20 2005

Keywords

Comments

Primes in A028839. [K. D. Bajpai, Jul 08 2014]
From Altug Alkan and Waldemar Puszkarz, Apr 10 2016: All terms are congruent to 1 mod 6. Proof: For n > 2, prime(n) is 1 or 5 mod 6. If p is 5 mod 6, then it is of the form 3*k-1. For numbers of this form, the sum of digits is also of this form, as can be seen through the kind of reasoning used in proving that numbers divisible by 3 have the sum of digits divisible by 3. However, 3*k-1 can never be a square, meaning n^2+1 is never divisible by 3: any n is equal to one of 0, 1, 2 mod 3, thus by the rules of modular arithmetic, n^2+1 is 1 or 2 mod 3, never 0. Hence p must be congruent to 1 mod 6.

Examples

			79 is in the sequence because it is prime. Also, (7 + 9) = 16 = 4^2.
997 is in the sequence because it is prime. Also, (9 + 9 + 7) = 25 = 5^2.
		

Crossrefs

Cf. A244863 (Semiprimes whose digit sum is square).

Programs

  • Maple
    with(numtheory): A107288:= proc() local a; a:=add(i,i = convert((n),base,10))(n); if isprime(n) and root(a,2)=floor(root(a,2)) then RETURN (n); fi; end: seq(A107288 (), n=1..5000); # K. D. Bajpai, Jul 08 2014
  • Mathematica
    bb = {}; Do[If[IntegerQ[Sqrt[Apply[Plus, IntegerDigits[p = Prime[n]]]]], bb = Append[bb, p]], {n, 500}]; bb
  • PARI
    lista(nn) = {forprime(p=2, nn, if (issquare(sumdigits(p)), print1(p, ", ")););} \\ Michel Marcus, Apr 09 2016

Extensions

Terms a(47) and a(48) added by K. D. Bajpai, Jul 08 2014

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

A048524 Primes for which only two iterations of 'Prime plus its digit sum equals a prime' are possible.

Original entry on oeis.org

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

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			prime 727 -> 727 + (7+2+7) = prime 743 -> 743 + (7+4+3) = prime 757 -> next iteration yields composite 776.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[1400]],Boole[PrimeQ[Rest[NestList[ #+Total[ IntegerDigits[ #]]&,#,3]]]] == {1,1,0}&] (* Harvey P. Dale, Oct 31 2018 *)

Extensions

Changed offset by Lars Blomberg, Dec 05 2013
Showing 1-10 of 28 results. Next