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

A069567 Smaller of two consecutive primes which are anagrams of each other.

Original entry on oeis.org

1913, 18379, 19013, 25013, 34613, 35617, 35879, 36979, 37379, 37813, 40013, 40213, 40639, 45613, 48091, 49279, 51613, 55313, 56179, 56713, 58613, 63079, 63179, 64091, 65479, 66413, 74779, 75913, 76213, 76579, 76679, 85313, 88379, 90379, 90679, 93113, 94379, 96079
Offset: 1

Views

Author

Amarnath Murthy, Mar 24 2002

Keywords

Comments

Smaller members of Ormiston prime pairs.
Given the n-th prime, it is occasionally possible to form the (n+1)th prime using the same digits in a different order. Such a pair is called an Ormiston pair.
Ormiston pairs occur rarely but randomly. It is thought that there are infinitely many but this has not been proved. They always differ by a multiple of 18. Ormiston triples also exist - see A075093.
"Anagram" means that both primes must not only use the same digits but must use each digit the same number of times. [From Harvey P. Dale, Mar 06 2012]
Dickson's conjecture would imply that the sequence is infinite, e.g. that there are infinitely many k for which 1913+3972900*k and 1931+3972900*k form an Ormiston pair. - Robert Israel, Feb 23 2017

Examples

			1913 and 1931 are two successive primes.
Although 179 and 197 are composed of the same digits, they do not form an Ormiston pair as several other primes intervene (i.e. 181, 191, 193).
		

References

  • Andy Edwards, Ormiston Pairs, Australian Mathematics Teacher, Vol. 58, No. 2 (2002), pp. 12-13.

Crossrefs

Programs

  • Haskell
    import Data.List (sort)
    a069567 n = a069567_list !! (n-1)
    a069567_list = f a000040_list where
       f (p:ps@(p':_)) = if sort (show p) == sort (show p')
                         then p : f ps else f ps
    -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    N:= 10^6: # to get all terms <= N
    R:= NULL: p:= 3: q:= 5:
    while p <= N do
      p:= q;
      q:= nextprime(q);
      if q-p mod 18 = 0 and sort(convert(p,base,10)) = sort(convert(q,base,10)) then
        R:= R, p
      fi
    od:
    R; # Robert Israel, Feb 23 2017
  • Mathematica
    Prime[ Select[ Range[10^4], Sort[ IntegerDigits[ Prime[ # ]]] == Sort[ IntegerDigits[ Prime[ # + 1]]] & ]]
    a = {1}; b = {2}; Do[b = Sort[ IntegerDigits[ Prime[n]]]; If[a == b, Print[ Prime[n - 1], ", ", Prime[n]]]; a = b, {n, 1, 10^4}]
    Transpose[Select[Partition[Prime[Range[8600]],2,1],Sort[IntegerDigits[ First[#]]] == Sort[ IntegerDigits[Last[#]]]&]][[1]] (* Harvey P. Dale, Mar 06 2012 *)
  • PARI
    is(n)=isprime(n)&&vecsort(Vec(Str(n)))==vecsort(Vec(Str(nextprime(n+1)))) \\ Charles R Greathouse IV, Aug 09 2011
    
  • PARI
    p=2;forprime(q=3,1e5,if((q-p)%18==0&&vecsort(Vec(Str(p)))==vecsort(Vec(Str(q))),print1(p", "));p=q) \\ Charles R Greathouse IV, Aug 09 2011, minor edits by M. F. Hasler, Oct 11 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, "".join(sorted(str(q)))
    print(list(islice(agen(), 38))) # Michael S. Branicky, Feb 19 2024

Extensions

Comments and references from Andy Edwards (AndynGen(AT)aol.com), Jul 09 2002
Edited by Robert G. Wilson v, Jul 15 2002 and Aug 29 2002
Minor edits by Ray Chandler, Jul 16 2009

A075093 Smallest member of Ormiston prime triple.

Original entry on oeis.org

11117123, 12980783, 14964017, 32638213, 32964341, 33539783, 35868013, 44058013, 46103237, 48015013, 50324237, 52402783, 58005239, 60601237, 61395239, 74699789, 76012879, 78163123, 80905879, 81966341, 82324237
Offset: 1

Views

Author

Robert G. Wilson v, Aug 31 2002

Keywords

Comments

A subsequence of A069567 which is in turn a subsequence of A072274. More precisely, this A075093 lists exactly the terms which precede repeated elements in A072274, since an Ormiston triple (p,q,r), i.e., three consecutive primes whose decimal representations are anagrams of each other, corresponds to two pairs (p,q) and (q,r), so that p=a(n) implies p=A072274(2k-1)=A069567(k) for some k, and q=A072274(2k)=A072274(2k+1)=A069567(k+1) and r=A072274(2k+2). - M. F. Hasler, Oct 11 2012

Examples

			The first Ormiston triples are 11117123, 11117213 and 11117321.
		

Crossrefs

Cf. A069567 - smaller member of an Ormiston prime pair.
Cf. A072274, A161160, A066540. - M. F. Hasler, Oct 11 2012

Programs

  • Haskell
    a075093 n = a075093_list !! (n-1)
    a075093_list = f a000040_list where
       f (p:ps@(q:r:_)) =
         if sort (show p) == sort (show q) && sort (show q) == sort (show r)
            then p : f ps else f ps
    -- Reinhard Zumkeller, Mar 09 2012
    
  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = 0; b = 1; Do[c = NextPrim[b]; If[ Sort[ IntegerDigits[a]] == Sort[ IntegerDigits[b]] == Sort[ IntegerDigits[c]], Print[a]]; a = b; b = c, {n, 1, 10^7}]
    op3Q[{a_,b_,c_}]:=Sort[IntegerDigits[a]]==Sort[IntegerDigits[b]] == Sort[ IntegerDigits[ c]]; Transpose[Select[Partition[Prime[ Range[ 5000000]],3,1], op3Q]][[1]] (* Harvey P. Dale, Jun 16 2014 *)
  • PARI
    is_A075093(n)={isprime(n) & vecsort(Vec(Str(n)))==vecsort(Vec(Str(n=nextprime(n+1)))) & vecsort(Vec(Str(n)))==vecsort(Vec(Str(nextprime(n+1))))} \\ M. F. Hasler, Oct 11 2012
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def hash(n): return "".join(sorted(str(n)))
    def agen(start=2): # generator of terms
        p = nextprime(start-1); q=nextprime(p); r=nextprime(q)
        hp, hq, hr = list(map(hash, [p, q, r]))
        while True:
            if hp == hq == hr: yield p
            p, q, r = q, r, nextprime(r)
            hp, hq, hr = hq, hr, hash(r)
    print(list(islice(agen(), 3))) # Michael S. Branicky, Feb 19 2024

A209396 Each entry is the first of three consecutive primes with equal digital sum.

Original entry on oeis.org

22193, 25373, 69539, 107509, 111373, 167917, 200807, 202291, 208591, 217253, 221873, 236573, 238573, 250073, 250307, 274591, 290539, 355573, 373073, 382373, 404273, 407083, 415391, 417383, 439009, 441193, 447907, 515173, 542837, 581873, 582083, 591673
Offset: 1

Views

Author

Antonio Roldán, Mar 13 2012

Keywords

Comments

Subsequence of A066540.
The differences between the three primes of the triple are multiples of 18.

Examples

			200807 is in the sequence because 200807, 200843, 200861 are consecutive primes and sum_of_digits(200807)= sum_of_digits(200843)= sum_of_digits(200861)=17
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[100000]], Total[IntegerDigits[#]] == Total[IntegerDigits[NextPrime[#, 1]]] == Total[IntegerDigits[NextPrime[#, 2]]] &] (* T. D. Noe, Mar 13 2012 *)
    Transpose[Select[Partition[Prime[Range[50000]],3,1],Differences[ Total/@ (IntegerDigits/@#)]=={0,0}&]][[1]] (* Harvey P. Dale, Jul 22 2016 *)

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

A209663 Numbers n with property that n is prime, n+18 is prime and both have equal sum of digits.

Original entry on oeis.org

5, 13, 19, 23, 29, 43, 53, 79, 109, 113, 139, 149, 163, 173, 179, 223, 233, 239, 263, 313, 349, 379, 439, 443, 449, 491, 503, 523, 569, 613, 643, 659, 673, 691, 709, 733, 739, 743, 769, 809, 839, 859, 863, 919, 929, 953, 1013, 1033, 1069, 1091, 1153, 1163
Offset: 1

Views

Author

Antonio Roldán, Mar 13 2012

Keywords

Comments

Supersequence of A066540.

Examples

			613 is in the sequence because 613 is prime, 613+18 = 631 is also prime. Sum_of_digits(613) = 10 and Sum_of_digits(631) = 10.
		

Crossrefs

Cf. A066540.

Programs

  • Magma
    [p: p in PrimesUpTo(1200) | IsPrime(p+18) and  &+Intseq(p) eq &+Intseq(p+18)]; // Bruno Berselli, Mar 13 2012

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

A209875 Primes p such that p and p+18 are consecutive primes with equal digital sum.

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, 14303, 14369, 15859, 15973, 16529, 16673, 16903, 17239, 17359
Offset: 1

Views

Author

Antonio Roldán, Mar 14 2012

Keywords

Comments

Subsequence of A066540 and A209663 (A066540 contains some consecutive primes with differences greater than 18; A209663 allows nonconsecutive primes).

Examples

			19013 is in the sequence because 19013 is prime, 19013 + 18 = 19031 is the next prime, and sum_of_digits(19013) = sum_of_digits(19031) = 14.
		

Crossrefs

Programs

  • PARI
    {forprime(n=3, 20000, my(m=nextprime(n+1)); if(m-n==18 && sumdigits(n) == sumdigits(m), print1(n, ", ")))} \\ Antonio Roldán, Dec 21 2012

Extensions

"Correction" of early 2012 undone by R. J. Mathar, Feb 20 2023

A217875 Primes which have the same (base 10) digital sum A007953 as the next smaller and next larger prime.

Original entry on oeis.org

22229, 25391, 69557, 107563, 111409, 167953, 200843, 202309, 208609, 217271, 221891, 236609, 238591, 250091, 250343, 274609, 290557, 355591, 373091, 382391, 404291, 407119, 415409, 417419, 439063, 441229, 447943, 515191, 542873, 581891, 582119, 591691, 614963
Offset: 1

Views

Author

M. F. Hasler, Oct 13 2012

Keywords

Crossrefs

A subsequence of A066540.

Programs

  • PARI
    {q=r=0; forprime(p=1,default(primelimit),(p-q)%18==0 & (q-r)%18==0 & A007953(p)==A007953(q) & A007953(p)==A007953(r) & print1(q","); r=q; q=p)}

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

A230220 Smaller of two consecutive palindromic primes with equal digital sum.

Original entry on oeis.org

11, 16661, 31513, 74747, 75557, 1035301, 1074701, 1303031, 1363631, 1374731, 1557551, 1646461, 1714171, 1777771, 1909091, 3075703, 3127213, 3452543, 3627263, 3635363, 3646463, 3746473, 3784873, 3948493, 3983893, 7057507, 7302037, 7354537, 7365637, 7622267
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 11 2013

Keywords

Examples

			11 is in the sequence because 11 and 101 are consecutive palindromic primes and the sum of the digits of each = 2.
		

Crossrefs

Showing 1-10 of 10 results.