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

A086003 Primes which remain prime after one and after two applications of the rotate-and-add operation of A086002.

Original entry on oeis.org

271, 281, 10853, 10903, 10939, 12917, 12919, 16603, 16673, 16823, 16843, 18671, 18911, 18913, 20929, 22817, 22907, 24907, 26813, 26833, 26903, 26947, 28661, 28901, 28921, 30809, 30829, 32831, 32917, 32941, 34939, 36653, 36913, 38651
Offset: 1

Views

Author

Chuck Seggelin, Jul 07 2003

Keywords

Comments

The rotate operation of nonnegative integers is defined in A086002, which lists the primes that remain prime after one application of the compound rotate-and-add operation. The sequence here lists those primes p which in addition remain prime after applying this transformation twice, that is, those elements of A086002 such that the image of the rotate-and-add operation is again in A086002.

Examples

			a(6)=12917 because (i) 12917 is prime. (ii) rotate(12917) = 17912 and 12917+17912=30829 which is also prime. (iii) rotate(30829) = 29830 and 30829+29830=60659 which is also prime.
		

Crossrefs

Formula

{p in A086002: p+rot(p) in A086002}.

Extensions

Edited by R. J. Mathar, May 27 2009

A086004 Primes which remain prime after one and after two and after three applications of the rotate-and-add operation of A086002.

Original entry on oeis.org

12917, 12919, 18911, 18913, 22907, 24907, 26903, 28901, 1088063, 1288043, 1408031, 1428029, 1528019, 100083679, 100280419, 100283849, 100483847, 100692793, 100880413, 101080159, 101283839, 101683093, 101683663, 102080149
Offset: 1

Views

Author

Chuck Seggelin, Jul 07 2003

Keywords

Comments

These are the primes of A086003 which in addition remain prime after one additional, third application of the rotate-and-add operation.
Note: Have not yet found any 4-Rotation Cycle Primes.
Conjecture 1: Rotation and addition of primes with even numbers of digits never yields a prime.
Conjecture 2: There are no 5-Rotation Cycle Primes.
[Conjecture 1 is true because rotation for even numbers of the form 10^k*a+b yields 10^k*b+a, so rotation-and-add yields (10^k+1)*(a+b), which obviously contains a divisor A000533. RJM, Sep 17 2009]
4-Rotation Cycle Primes exist and are listed in A261458. - Chai Wah Wu, Aug 20 2015

Examples

			a(1)=12917 is in the sequence because 2-fold rotate-and-add yields the prime 60659 as shown in A086003, and the third application yields 60659+59660 = 120319 which still is prime.
		

Crossrefs

Programs

  • Mathematica
    rot[n_]:=Module[{idn=IntegerDigits[n],len},len=Length[idn];If[OddQ[ len],FromDigits[ Join[ Take[idn,-Floor[len/2]],{idn[[(len+1)/2]]},Take[idn,Floor[len/2]]]],FromDigits[ Join[ Take[idn,-len/2],Take[idn,len/2]]]]]; a3rotQ[n_]:=AllTrue[Rest[NestList[ #+rot[ #]&,n,3]],PrimeQ]; Select[Prime[Range[5880000]],a3rotQ] (* Harvey P. Dale, Apr 26 2022 *)

Formula

{p in A086003: p+rot(p) in A086003}.

Extensions

Condensed by R. J. Mathar, Sep 17 2009

A261458 Primes which remain prime after one, two, three and four applications of the rotate-and-add operation of A086002.

Original entry on oeis.org

10010905789, 10028905771, 10036905763, 10050905749, 10056905743, 10060905739, 10070905729, 10080905719, 10092905707, 10098905701, 10102905697, 10106905693, 10108905691, 10112905687, 10130905669, 10160905639, 10172905627, 10176905623, 10188905611, 10190905609
Offset: 1

Views

Author

Chai Wah Wu, Aug 20 2015

Keywords

Comments

There are no primes that remain prime each time after 1,2,...,6 rotate-and-add operations. Proof: by the comment in A086004, such a prime p must have an odd number of digits and must remain so after 1,2,...,5 rotate-and-add operations. Let p have 2m+1 digits, and denote the first and the (m+2)-th digits as (a,b). After a rotate-and-add operation, these digits become (c,d). It is clear that c >= a+b, d >= a+b, except when a carry occur at these digits. If a carry occurred at the (m+2)-th digit, then a carry occurred at the first digit as well. In any case when a carry occurred at these digits, the number of digits is increased by 1 and thus will have even number of digits. This implies that for such a prime p, a carry did not occur after each of the 5 rotate-and-adds. The best one can do is if (a,b) = (1,0), after 4 rotate-and-adds the digits becomes (1,1), (2,2), (4,4), (8,8) or larger and thus a carry will have occurred after at most 5 rotate-and-adds, so such a prime does not exist. - Chai Wah Wu, Aug 21 2015

Examples

			Applying rotate-and-add to the prime 10010905789 four times results in 15800815799, 31600631599, 63200263199, 126399526399, all of which are prime.
		

Crossrefs

A061783 Luhn primes: primes p such that p + (p reversed) is also a prime.

Original entry on oeis.org

229, 239, 241, 257, 269, 271, 277, 281, 439, 443, 463, 467, 479, 499, 613, 641, 653, 661, 673, 677, 683, 691, 811, 823, 839, 863, 881, 20011, 20029, 20047, 20051, 20101, 20161, 20201, 20249, 20269, 20347, 20389, 20399, 20441, 20477, 20479, 20507
Offset: 1

Views

Author

Amarnath Murthy, May 24 2001

Keywords

Comments

a(n) has an odd number of digits, as otherwise a(n) + reverse(a(n)) is a multiple of 11. For a(n) > 10, a(n) is prime and thus odd, and therefore the first digit of a(n) is even as otherwise a(n) + reverse(a(n)) is even and composite. - Chai Wah Wu, Aug 19 2015
See A072385 for the resulting primes p + reverse(p) = A056964(p). - M. F. Hasler, Sep 26 2019
Named by Cira and Smarandache (2014) after Norman Luhn, who noted the property of the prime 229 on the Prime Curios! website. - Amiram Eldar, Jun 05 2021

Examples

			229 is a term since 229 is a prime and so is 229 + 922 = 1151.
		

Crossrefs

Cf. A004086 (reverse), A004087 (primes reversed), A056964 (reverse & add), A072385, A086002 (similar, using "rotate" instead of "reverse").

Programs

  • Magma
    [NthPrime(n): n in [1..2400] | IsPrime(s) where s is NthPrime(n)+Seqint(Reverse(Intseq(NthPrime(n))))]; // Bruno Berselli, Aug 05 2013
    
  • Mathematica
    Select[Prime[Range[3000]],PrimeQ[#+FromDigits[Reverse[IntegerDigits[#]]]]&] (* Harvey P. Dale, Nov 27 2010 *)
  • PARI
    isok(p) = { isprime(p) && isprime(p + fromdigits(Vecrev(digits(p)))) } \\ Harry J. Smith, Jul 28 2009
    
  • PARI
    select( is_A061783(p)=isprime(A056964(p)) && isprime(p), primes(8713)) \\  A056964(p)=p+fromdigits(Vecrev(digits(p))). There is no term with 4 digits or starting with an odd digit, i.e., no candidate between prime(168) = 997 and prime(2263) = 20011. Using primes up to prime(8713) = 89989 ensures the list of 5-digit terms is complete. - M. F. Hasler, Sep 26 2019
    
  • Python
    from sympy import isprime, prime
    A061783 = [prime(n) for n in range(1,10**5) if isprime(prime(n)+int(str(prime(n))[::-1]))] # Chai Wah Wu, Aug 14 2014

Extensions

Corrected and extended by Patrick De Geest, May 26 2001
Cross-references added by M. F. Hasler, Sep 26 2019

A072385 Primes which can be represented as the sum of a prime and its reverse.

Original entry on oeis.org

383, 443, 463, 787, 827, 887, 929, 1009, 1049, 1069, 1151, 1171, 1231, 1373, 1453, 1493, 1777, 30203, 30403, 31013, 32213, 32413, 32423, 33023, 33223, 34033, 34843, 35053, 36263, 36653, 37273, 37463, 37663, 38083, 38273, 38873, 39293, 39883
Offset: 1

Views

Author

Shyam Sunder Gupta, Jul 20 2002

Keywords

Comments

This set is the image under the "reverse and add" operation (A056964) of the Luhn primes A061783 (which remain prime under that operation). Those have always an odd number of digits, and start with an even digit. Therefore this sequence has its terms in intervals [3,20]*100^k with k = 1, 2, 3.... - M. F. Hasler, Sep 26 2019

Examples

			383 is a term because it is prime and it is the sum of prime 241 and its reverse 142.
		

Crossrefs

Cf. A004086 (reverse), A004087 (primes reversed), A056964 (reverse & add), A061783 (Luhn primes), A086002 (similar, using "rotate" instead of "reverse").

Programs

  • Mathematica
    f@n_:=(Select[# + IntegerReverse[#] & /@ Prime[Range[n]], PrimeQ@# && # <= Prime[n] &] // Union); f@3000 (* Harvey P. Dale, Jul 18 2018; corrected by Hans Rudolf Widmer, Aug 15 2024 *)
  • PARI
    is_A072385(p)={isprime(p)&&forprime(q=p\10,p*9\10,A056964(q)==p&&return(1))} \\ A056964(n)=n+fromdigits(Vecrev(digits(n))). It is much faster to produce the terms as shown below, rather than to "select" them from a range of primes. - M. F. Hasler, Sep 26 2019
    
  • PARI
    A072385=Set(apply(A056964, A061783)) \\ with, e.g.: A061783=select(is_A061783(p)={isprime(A056964(p))&&isprime(p)}, primes(8713)) - M. F. Hasler, Sep 26 2019

Formula

a(n) = A056964(A061783(n)). - M. F. Hasler, Sep 26 2019

Extensions

Cross-references added by M. F. Hasler, Sep 26 2019

A327825 "Rotation" of n: swap the first [d/2] and last [d/2] digits, when n has d digits.

Original entry on oeis.org

979, 89, 189, 289, 389, 489, 589, 689, 789, 889, 989, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 10, 110, 210, 310, 410, 510, 610, 710, 810, 910, 1010, 1110, 1210, 1310, 1410, 1510, 1610, 1710, 1810, 1910, 2010, 2110, 2210, 2310, 2410, 2510, 2610, 2710, 2810, 2910, 3010, 3110, 3210
Offset: 979

Views

Author

M. F. Hasler, Sep 26 2019

Keywords

Comments

When n has an odd number of digits, the middle one remains at its place.
This operation, denoted "rotation" k -> rot(k) in sequences A086002, A086003, A086004, is indistinguishable from A004086 (reverse n) for numbers < 1000. Therefore the offset is chosen as to have 2/3 of the displayed terms beyond this limit and 1/3 below. This makes it easy to find the sequence searching for the terms near that limit, ..., 999, 10, 110, 210,....

Examples

			a(123) = concat(3, 2, 1) = 321.
a(1234) = concat(34, 12) = 3412.
a(12345) = concat(45, 3, 12) = 45312.
		

Crossrefs

Programs

  • PARI
    a(n)={n=digits(n); fromdigits(concat([n[#n\/2+1..#n],n[#n\2+1..#n\/2],n[1..#n\2]]))}

Formula

a(n) = A004086(n) ("reverse n") for n < 1000.
Showing 1-6 of 6 results.