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.

A262988 Number of distinct primes, including n if prime, obtained by cyclically shifting the digits of n.

This page as a plain text file.
%I A262988 #15 Oct 31 2015 14:52:45
%S A262988 0,1,1,0,1,0,1,0,0,0,1,0,2,1,0,1,2,0,1,1,0,0,1,0,0,0,0,0,1,1,2,1,0,1,
%T A262988 1,0,2,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,
%U A262988 0,1,2,0,2,1,0,1,0,0,2,0,0,0,1,0,0,0,0
%N A262988 Number of distinct primes, including n if prime, obtained by cyclically shifting the digits of n.
%C A262988 First differs from A039999 at n = 103.
%C A262988 Differs from A061264 iff n is a term of A004022.
%C A262988 a(n) = A055642(n) iff n is a term of A068652, except when n is also in A004022.
%H A262988 Felix Fröhlich, <a href="/A262988/b262988.txt">Table of n, a(n) for n = 1..10000</a>
%e A262988 a(1013) = 2, because of the four cyclic permutations of the digits of 1013 (1013, 131, 1310, 3101) two, namely 1013 and 131, are prime and those two primes are distinct.
%t A262988 f[n_] := Block[{len = IntegerLength@ n, s = {n}}, Do[AppendTo[s, FromDigits@ RotateRight@ IntegerDigits@ s[[k - 1]]], {k, 2, len}]; DeleteDuplicates@ Select[s, PrimeQ]]; Array[ Length@ f@ # &, {87}] (* _Michael De Vlieger_, Oct 07 2015 *)
%o A262988 (PARI) rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
%o A262988 eva(n) = x=0; for(k=1, #n, x=x+(n[k]*10^(#n-k))); x
%o A262988 a(n) = i=0; r=rot(digits(n)); while(r!=digits(n), if(ispseudoprime(eva(r)), i++); r=rot(r)); if(ispseudoprime(eva(r)), i++); i
%Y A262988 Cf. A016114, A039999, A045978, A061264, A068652, A068653, A068654, A069219, A247153.
%K A262988 nonn,base
%O A262988 1,13
%A A262988 _Felix Fröhlich_, Oct 06 2015