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.

A317716 Square array A(n, k), read by antidiagonals downwards: k-th prime p such that cyclic digit shifts produce exactly n different primes.

Original entry on oeis.org

2, 3, 13, 5, 17, 113, 7, 31, 131, 1193, 11, 37, 197, 1931, 11939, 19, 71, 199, 3119, 19391, 193939, 23, 73, 311, 3779, 19937, 199933, 17773937, 29, 79, 337, 7793, 37199, 319993, 39371777, 119139133, 41, 97, 373, 7937, 39119, 331999, 71777393, 133119139
Offset: 1

Views

Author

Felix Fröhlich, Aug 05 2018

Keywords

Comments

k-th prime p such that A262988(p) = n.
Are all rows of the array infinite?
A term q of A270083 occurs in row A055642(q) - 1 in this array.
A term r of A293663 occurs in row A055642(r) in this array.
Row 1 is a supersequence of A004022.
Column 1 is A247153.

Examples

			Array starts
          2,         3,         5,         7,        11,        19,        23, ...
         13,        17,        31,        37,        71,        73,        79, ...
        113,       131,       197,       199,       311,       337,       373, ...
       1193,      1931,      3119,      3779,      7793,      7937,      9311, ...
      11939,     19391,     19937,     37199,     39119,     71993,     91193, ...
     193939,    199933,    319993,    331999,    391939,    393919,    919393, ...
   17773937,  39371777,  71777393,  73937177,  77393717,  77739371,  93717773, ...
  119139133, 133119139, 139133119, 191391331, 311913913, 331191391, 913311913, ...
...
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    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
    count_primes(n) = my(d=digits(n), i=0); while(1, if(ispseudoprime(eva(d)), i++); d=rot(d); if(d==digits(n), return(i)))
    row(n, terms) = my(i=0); forprime(p=1, , if(count_primes(p)==n, print1(p, ", "); i++); if(i==terms, print(""); break))
    array(rows, cols) = for(x=1, rows, row(x, cols))
    array(7, 7) \\ print initial 7 rows and 7 columns of array

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

Original entry on oeis.org

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, 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, 0, 1, 2, 0, 2, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Felix Fröhlich, Oct 06 2015

Keywords

Comments

First differs from A039999 at n = 103.
Differs from A061264 iff n is a term of A004022.
a(n) = A055642(n) iff n is a term of A068652, except when n is also in A004022.

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • 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
    eva(n) = x=0; for(k=1, #n, x=x+(n[k]*10^(#n-k))); x
    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

A380655 Smallest prime p > 10^(n-1) for which successive cyclic shifts of digits by 1, ..., n-1 positions to the left are all prime, or -1 if no such p exists.

Original entry on oeis.org

2, 11, 113, 1193, 11939, 193939, 71777393, 913311913, 93739179151, 317793117877, 731779311787, 1373779119729007
Offset: 1

Views

Author

Jean-Marc Rebert, Jan 29 2025

Keywords

Examples

			_n_p__shifts of digits by 1, ..., n-1 positions (n <= number of digits of p) to the left
 1 2 -> ;
 2 11 -> 11;
 3 113 -> 131, 311;
 4 1193 -> 1931, 9311, 3119;
 5 11939 -> 19391, 93911, 39119, 91193;
 6 193939 -> 939391, 393919, 939193, 391939, 919393;
 7 71777393 -> 17773937, 77739371, 77393717, 73937177, 39371777, 93717773, but 37177739 = 29 * 683 * 1877;
 8 913311913 -> 133119139, 331191391, 311913913, 119139133, 191391331, 913913311, 139133119, but 391331191 = 29 * 131 * 239 * 431;
 9 93739179151 -> 37391791519, 73917915193, 39179151937, 91791519373, 17915193739, 79151937391, 91519373917, 15193739179, but 51937391791 = 419 * 887 * 139747;
10 317793117877 -> 177931178773, 779311787731, 793117877317, 931178773177, 311787731779, 117877317793, 178773177931, 787731779311, 877317793117, but 773177931178 = 2 * 386588965589;
11 731779311787 -> 317793117877, 177931178773, 779311787731, 793117877317, 931178773177, 311787731779, 117877317793, 178773177931, 787731779311, 877317793117, but 773177931178 = 2 * 386588965589;
12 1373779119729007 -> 3737791197290071, 7377911972900713, 3779119729007137, 7791197290071373, 7911972900713737, 9119729007137377, 1197290071373779, 1972900713737791, 9729007137377911, 7290071373779119, 2900713737791197, but 9007137377911972 = 2^2 * 13 * 6841 * 25320008821;
		

Crossrefs

Programs

  • Python
    from itertools import count, product
    from sympy import isprime
    def A380655(n):
        if n == 1: return 2
        for l in count(n):
            for a in product('1379', repeat=n-1):
                for b in product('0123456789', repeat=l-n):
                    for c in '1379':
                        d = ''.join(a+b)+c
                        if all(isprime(int(d[i:]+d[:i])) for i in range(n)):
                            return int(d) # Chai Wah Wu, Jan 30 2025

Extensions

a(10) and a(11) corrected by Chai Wah Wu, Jan 30 2025
Name edited by Pontus von Brömssen, Feb 03 2025
a(12) from Chai Wah Wu, Feb 06 2025

A317756 Number of distinct primes obtained by cyclically shifting the decimal digits of the n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 2, 2, 2, 3, 1, 1, 1, 2, 2, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2
Offset: 1

Views

Author

Keywords

Comments

First occurrence of k, k=1,2,3,...: 2, 13, 113, 1193, 11939, 193939, 17773937, 119139133, ..., . A247153.
a(n) is equal to the row index of prime(n) in A317716.
Every positive integer occurs in this sequence if and only if A247153(i) != 0 for every i >= 1.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{len = IntegerLength@n, s = {n}}, Do[AppendTo[s, FromDigits@RotateRight@IntegerDigits@s[[k - 1]]], {k, 2, len}]; DeleteDuplicates@Select[s, PrimeQ]] (* after Michael De Vlieger in A262988 *); Array[Length@f@Prime@# &, 105] (* Robert G. Wilson v, Aug 06 2018 *)
    Table[Count[Union[FromDigits/@Table[RotateRight[IntegerDigits[p],n],{n,IntegerLength[p]}]],?PrimeQ],{p,Prime[Range[120]]}] (* _Harvey P. Dale, Jan 18 2025 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    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
    count_primes(n) = my(d=digits(n), i=0); while(1, if(ispseudoprime(eva(d)), i++); d=rot(d); if(d==digits(n), return(i)))
    a(n) = my(p=prime(n)); count_primes(p) \\ Felix Fröhlich, Aug 06 2018

Formula

a(n) = A262988(A000040(n)).

A380669 Smallest prime p > 10^(n-1) for which successive cyclic shifts of digits by 1, ..., n-1 positions to the right are all prime, or -1 if no such p exists.

Original entry on oeis.org

2, 11, 113, 1193, 11939, 193939, 93717773, 139133119, 15193739179, 153991739117, 877317793117
Offset: 1

Views

Author

Jean-Marc Rebert, Jan 30 2025

Keywords

Comments

For n in A004023, a(n) = (10^n-1)/9. - Robert Israel, Feb 04 2025

Examples

			n p  shifts of digits by 1, ..., n-1 positions (n <= number of digits of p) to the right
1 2 -> ;
2 11 -> 11;
3 113 -> 311, 131;
4 1193 -> 3119, 9311, 1931;
5 11939 -> 91193, 39119, 93911, 19391;
6 193939 -> 919393, 391939, 939193, 393919, 939391;
7 93717773 -> 39371777, 73937177, 77393717, 77739371, 17773937, 71777393, but 37177739 = 29 * 683 * 1877;
8 139133119 -> 913913311, 191391331, 119139133, 311913913, 331191391, 133119139, 913311913, but 391331191 = 29 * 131 * 239 * 431;
9 15193739179 -> 91519373917, 79151937391, 17915193739, 91791519373, 39179151937, 73917915193, 37391791519, 93739179151, but 19373917915 = 5 * 11 * 29 * 823 * 14759;
10 153991739117 -> 715399173911, 171539917391, 117153991739, 911715399173, 391171539917, 739117153991, 173911715399, 917391171539, 991739117153, but 399173911715 = 5 * 79834782343;
11 877317793117 -> 787731779311, 178773177931, 117877317793, 311787731779, 931178773177, 793117877317, 779311787731, 177931178773, 317793117877, 731779311787, but 773177931178 = 2 * 386588965589;
		

Crossrefs

Extensions

a(9)-a(11) corrected by Pontus von Brömssen, Feb 24 2025
Showing 1-5 of 5 results.