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

A086002 Primes which when added to their own rotation yield 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, 10111, 10151, 10169, 10181, 10243, 10247, 10253, 10267, 10303, 10313, 10331, 10343, 10391, 10429, 10453, 10457
Offset: 1

Views

Author

Chuck Seggelin, Jul 07 2003

Keywords

Comments

Let rotation rot(k) of a number k be defined by swapping the blocks of the first [d/2] and of the last [d/2] digits of k, where d=A055642(k). If the number of digits in k is odd, the center digit remains untouched during rotation.
So for example the rotation of 1234 is 3412, while the rotation of 12345 is 45312.
Rotation differs from reversal (A004086) for numbers with at least 4 digits, that is, after A004087(168) if we are concerned with primes.
The sequence lists primes p such that p+rot(p) is (again) prime.
Differs from A061783, where rot(k) is replaced by reverse(k), from the 5-digit terms on. - M. F. Hasler, Mar 03 2011
a(n) has an odd number of digits (see RJM comment in A086004). If a(n) has 2m+1 digits, then the m-th digit of a(n) is even as otherwise a(n) + rot(a(n)) is even. - Chai Wah Wu, Aug 19 2015

Examples

			a(100)=12917 because (i) 12917 is prime and (ii) rotate(12917) = 17912 and 12917+17912=30829, which is also prime.
		

Crossrefs

Programs

  • Maple
    A055642 := proc(n) max(1,1+ilog10(n)) ; end:
    rot := proc(n) local d,dl,dh,pre,suf ; d := A055642(n) ; dl := floor( d/2) ; dh := floor( (d+1)/2) ; pre := floor(n/10^dh) ; suf := n mod 10^dl ; if dl <> dh then suf*10^dh+pre+10^dl*( floor(n/10^dl) mod 10) ; else suf*10^dh+pre ; fi; end:
    isA086002 := proc(p) if isprime(p) then isprime(p+rot(p)) ; else false; fi; end:
    for n from 1 to 1500 do p := ithprime(n) ; if isA086002(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, May 27 2009
  • 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]]]]]; Select[Prime[Range[1500]],PrimeQ[ #+rot[#]]&] (* Harvey P. Dale, Apr 26 2022 *)

Extensions

Edited by R. J. Mathar, May 27 2009

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

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

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