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

A066540 The first of two consecutive primes with equal digital sums.

Original entry on oeis.org

523, 1069, 1259, 1759, 1913, 2503, 3803, 4159, 4373, 4423, 4463, 4603, 4703, 4733, 5059, 5209, 6229, 6529, 6619, 7159, 7433, 7459, 8191, 9109, 9749, 9949, 10691, 10753, 12619, 12763, 12923, 13763, 14033, 14107, 14303, 14369, 15859, 15973, 16529, 16673, 16903, 17239
Offset: 1

Views

Author

Jason Earls, Jan 06 2002

Keywords

Comments

The difference between the two primes of the pair is a multiple of 18. - Antonio Roldán, Mar 13 2012

Examples

			a(1) = 523 because both it and the next prime, 541, have a digital sum of 10.
		

Crossrefs

Subsequence of A117838. A069567 is a subsequence.

Programs

  • Mathematica
    Prime[ Select[Range[2000], Apply[ Plus, IntegerDigits[ Prime[ # ]]] == Apply[ Plus, IntegerDigits[ Prime[ # + 1]]] & ]]
    Prime[#]&/@(SequencePosition[Total[IntegerDigits[#]]&/@Prime[Range[2000]],{x_,x_}][[;;,1]]) (* Harvey P. Dale, Mar 27 2025 *)
  • PARI
    upto(limit)={my(d=2, L=List()); forprime(p=3, nextprime(limit+1), my(s=sumdigits(p)); if(s==d, listput(L, precprime(p-1))); d=s); Vec(L) } \\ Harry J. Smith, Feb 22 2010
    
  • PARI
    is_A066540(p)={my(n=nextprime(p+1)); (n-p)%18==0 & isprime(p) & A007953(p)==A007953(n)}  \\ M. F. Hasler, Oct 13 2012
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        p, hp, q, hq = 2, 2, 3, 3
        while True:
            if hp == hq: yield p
            p, q = q, nextprime(q)
            hp, hq = hq, sum(map(int, str(q)))
    print(list(islice(agen(), 42))) # Michael S. Branicky, Feb 19 2024

A210629 Each entry is the first of four consecutive primes with equal digital sum.

Original entry on oeis.org

1442173, 2288509, 2660183, 2805773, 3830891, 4137473, 4951073, 5216137, 5517173, 5521819, 5521891, 5914591, 6474119, 6518173, 7118519, 7570273, 8508473, 8584273, 8689573, 8912591, 9383053, 9958519, 10116373, 10204391, 11418193, 11878873, 11890873, 12948773, 13738163, 13873073, 14377157, 14436391, 14677573, 14732191
Offset: 1

Views

Author

Harvey P. Dale, Mar 25 2012

Keywords

Comments

The differences between each of the 4-consecutive primes are multiples of 18. - Harvey P. Dale, Jul 22 2016

Examples

			2288509 is in the sequence because 2288509, 2288527, 2288563, and 2288581 are consecutive primes and the sum of the digits of each = 34
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[1000000]],4,1],Total[ IntegerDigits[#[[1]]]]==Total[IntegerDigits[#[[2]]]] == Total[ IntegerDigits[#[[3]]]]==Total[IntegerDigits[#[[4]]]]&]][[1]]
    Transpose[Select[Partition[Prime[Range[10^6]],4,1], Differences[ Total/@ (IntegerDigits/@#)]=={0,0,0}&]][[1]] (* Harvey P. Dale, Jul 22 2016 *)

A227931 Smallest sets of 5 consecutive primes with equal digital sum. The initial prime is listed.

Original entry on oeis.org

5521819, 33014273, 36183593, 39874273, 47143739, 82934191, 83640653, 86225437, 89121073, 99551093, 104663773, 108616619, 109514719, 117611519, 131616409, 142348637, 151942291, 168056137, 168066791, 172096037, 196415237, 197604227, 203519819, 204983507
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 06 2013

Keywords

Examples

			5521819 is in the sequence because 5521819, 5521891, 5521927, 5521963 and 5521981 are consecutive primes and the sum of the digits of each = 31.
		

Crossrefs

Programs

  • Mathematica
    a = {}; m = 1; s = 1; Do[If[(y = Apply[Plus, IntegerDigits[x = Prime[n]]]) == s , m = m + 1; If[m == 6, AppendTo[a, Prime[n - 5]]], m = 1]; s = y, {n, 2, 100000000}];a
    Select[Partition[Prime[Range[11340000]],5,1],Length[Union[Total/@(IntegerDigits/@ #)]] == 1&][[All,1]] (* Harvey P. Dale, Apr 14 2022 *)

A227933 Smallest sets of 6 consecutive primes with equal digital sum. The initial prime is listed.

Original entry on oeis.org

354963229, 448024483, 467739719, 475313609, 525523709, 771943583, 790277219, 881160173, 901572019, 925569683, 1051470419, 1085896727, 1110999817, 1285560163, 1331768783, 1455016319, 1472310383, 1519074619, 1628600381, 1815368519, 1914032047, 1990306673
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 06 2013

Keywords

Examples

			354963229 is in the sequence because 354963229, 354963283, 354963319, 354963337, 354963373 and 354963391 are consecutive primes and the sum of the digits of each = 43
		

Crossrefs

Programs

  • Mathematica
    a = {}; m = 1; s = 1; Do[If[(y = Apply[Plus, IntegerDigits[x = Prime[n]]]) == s , m = m + 1; If[m == 6, AppendTo[a, Prime[n - 5]]], m = 1]; s = y, {n, 2, 200000000}];a

A230221 Smallest of three consecutive palindromic primes with equal digital sum.

Original entry on oeis.org

74747, 3627263, 110343011, 120565021, 127747721, 156262651, 185595581, 185676581, 304585403, 309272903, 317565713, 317646713, 329585923, 340191043, 350474053, 368171863, 368696863, 375070573, 376080673, 383666383, 398676893, 728555827, 923393329, 926787629
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 12 2013

Keywords

Examples

			74747 is in the sequence because 74747, 75557 and 76367 are consecutive palindromic primes and the sum of the digits of each = 29.
		

Crossrefs

Showing 1-5 of 5 results.