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.

A260851 a(n) in base n is the concatenation of the base n expansions of (1, 2, 3, ..., n-1, n, n-1, ..., 3, 2, 1).

Original entry on oeis.org

1, 13, 439, 27961, 3034961, 522134761, 131870760799, 45954960939217, 21107054541321649, 12345678910987654321, 8954302429379707945271, 7883984846509322664831433, 8281481197999449959084458465, 10228838696316240496325238416281, 14674825961700306151086890240104831
Offset: 1

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

Sequences A173427, A260853 - A260859, A173426, A260861 - A260866, A260860 list the numbers A_b(n) whose base b expansion is the concatenation of the base b expansions of (1, 2, ..., n, n-1, ..., 1). For n < b these are the squares of the repdigits of length n in base b, so the first candidate for a prime is the term with n = b. These are the numbers listed here. Sequence A260343 gives the bases b for which this is indeed a prime, the corresponding primes a(A260343(n)) are listed in A260852.
The initial term a(1) = 1 refers to the unary or "tally mark" representation of the numbers, cf. A000042. It can be considered as purely conventional.

Examples

			a(1) = 1 is the "concatenation" of (1) which is the unary representation of 1, cf A000042.
a(2) = 13 = 1101[2] = concatenation of (1, 10, 1), where 10 is the base 2 representation of 2.
a(3) = 439 = 121021[3] = concatenation of (1, 2, 10, 2, 1), where 10 is the base 3 representation of 3.
a(10) = 12345678910987654321 is the concatenation of (1, 2, 3, ..., 9, 10, 9, 8, ..., 2, 1); it is also a prime.
		

Crossrefs

For primes in this sequence see A260343, A260852.

Programs

  • Magma
    [1] cat [((n^n-1)/(n-1) - n + 1)*(1 + n*(n^n-1)/(n-1)) - 1: n in [2..15]]; // Vincenzo Librandi, Aug 02 2015
    
  • Maple
    f:=proc(b) local i;
    add((i+1)*b^i, i=0..b-2) + b^b + add(i*b^(2*b-i),i=1..b-1); end;
    [seq(f(b),b=1..25)]; # N. J. A. Sloane, Sep 26 2015
  • Mathematica
    Join[{1}, Table[((n^n - 1)/(n - 1) - n + 1) (1 + n (n^n - 1)/(n - 1)) - 1, {n, 2, 30}]] (* Vincenzo Librandi, Aug 02 2015 *)
  • PARI
    A260851(n)=(1+n*r=if(n>2,n^n\(n-1),n*2-1))*(r-n+1)-1
    
  • Python
    def A260851(n): return sum(i*(n**(2*n-i)+n**(i-1)) for i in range(1, n)) + n**n # Ya-Ping Lu, Dec 23 2021

Formula

a(n) = n*r + (r - n)*(1 + n*r) = (r - n + 1)*(1 + n*r) - 1, where r = (n^n-1)/(n-1) is the base n repunit of length n, r = 1 for n = 1.
Another closed-form expression for the series is a(n) = (n^(2*n+1) + (-n^3 + 2*n^2 - 2*n - 1)*n^n + 1)/(n - 1)^2. - Serge Batalov, Aug 02 2015

A260852 Primes in A260851: numbers whose base n expansion is equal to the concatenation of the base n expansions of (1, 2, 3, ..., n-1, n, n-1, ..., 3, 2, 1).

Original entry on oeis.org

13, 439, 27961, 522134761, 21107054541321649, 12345678910987654321, 24197857203266734883076090685781525281
Offset: 1

Views

Author

M. F. Hasler, Aug 02 2015

Keywords

Comments

Primes of the form (1+r(b)*b)*(r(b)-b+1)-1 with r(b)=(b^b-1)/(b-1).
Sequences A173427, A260853 - A260859, A173426, A260861 - A260866, A260860 list the numbers whose base b expansion is the concatenation of the base b expansions of (1, 2, ..., n, n-1, ..., 1). For n < b these are the squares of the repdigits of length n in base b, so the first candidate is the b-th term. These are the numbers listed in A260851. For the bases listed in A260343, this candidate is indeed prime: these are the primes listed here.
a(8) = A260851(40) has already 127 digits and is therefore too large to be displayed here.

Crossrefs

Programs

  • PARI
    for(b=2,999,ispseudoprime(p=(1+b*c=(b^b-1)\(b-1))*(c-b+1)-1)&&print1(p","))

Formula

a(n) = A260851(A260343(n)).

A260871 Primes whose base-b representation is the concatenation of the base-b representations of (1, 2, ..., k, k-1, ..., 1), for some b > 1 and some k > 1.

Original entry on oeis.org

13, 439, 7069, 27961, 2864599, 522134761, 21107054541321649, 12345678910987654321, 1919434248892467772593071038679, 24197857203266734883076090685781525281, 1457624695486449811479514346937750581569993, 1263023202979901596155544853826881857760357011832664659152364441
Offset: 1

Views

Author

M. F. Hasler, Aug 02 2015; edited Aug 23 2015

Keywords

Comments

The sequences A[b] of numbers whose base-b representation is the concatenation of the base-b representations of (1, 2, ..., k, k-1, ..., 1), for a given b and all k >= 1, are recorded as A173427, A260853 - A260859, A173426, A260861 - A260866 and A260860 for bases b=2, ..., b=16 and b=60.
This is a supersequence of A260852, which lists only primes of the form A[b](b) - see A260343 for the b-values. In addition, the numbers A[b](b+2) are also prime for b=(2, 3, 11, 62, 182, ...), corresponding to terms a(3) = 7069, a(5) = 2864599, a(9) = 1919434248892467772593071038679, ... Still other examples are a(11) = A[12](16), a(12) = A[14](21), ... See the Broadhurst file for further data. [Edited by N. J. A. Sloane, Aug 24 2015]
Other subsequences of the form A[b](b+d) with at least 4 probable primes include: d=36, b=(2, 103, 117, 2804, ...); d=70, b=(74, 225, 229, 545, ...); d=200, b=(126, 315, 387, 2697, ...). For odd d, I know of 2 series with at least 3 probable primes: d=15, b=(18, 154, 1262, ...); d=165, b=(522, 602, 1858,...). - David Broadhurst, Aug 28 2015
See A261170 for the number of decimal digits of a(n); A261171 and A261172 for the k- and b-values such that a(n) = A[b](k). - M. F. Hasler, Sep 15 2015

Examples

			The first two terms are of the form A[b](b) with b=2 and b=3:
a(1) = 13 = 1101_2 = concat(1, 2=10_2, 1).
a(2) = 439 = 121021_3 = concat(1, 2, 3=10_3, 2, 1).
See comments for further examples.
		

Crossrefs

The sequences A[b] are listed in A173427 for b=2, A260853 for b=3, A260854 for b=4, A260855 for b=5, A260856 for b=6, A260857 for b=7, A260858 for b=8, A260859 for b=9, A173426 for b=10, A260861 for b=11, A260862 for b=12, A260863 for b=13, A260864 for b=14, A260865 for b=15, A260866 for b=16, A260860 for b=60.

Programs

  • PARI
    {L=1e99;A260871=List();for(b=2,9e9,for(n=b,9e9,if(Lb)));ispseudoprime(p)&&listput(A260871,p)));vecsort(A260871)}

A261171 Value of k for which A260871(n) = A[b](k), with b = A261172(n); A[b](k) = the number whose base-b representation is the concatenation of the base-b representations of (1, ..., k, k-1, ..., 1).

Original entry on oeis.org

2, 3, 4, 4, 5, 6, 9, 10, 13, 16, 16, 21, 23, 23, 29, 28, 38, 39, 33, 34, 41, 40, 37, 37, 41, 42, 44, 64, 77, 82, 75, 83, 83, 87, 104, 104, 86, 94
Offset: 1

Views

Author

M. F. Hasler, Aug 23 2015

Keywords

Comments

For more data, see the 3rd column of D. Broadhurst's list of [n, b, k, length(A260871(n))] given in A260871.
This and the companion sequence A261172 are a compact way of recording the very large primes listed in A260871 by means of the k- and b-value such that A260871(n) = A[A261172(n)](A261171(n)). See A261170 for the number of decimal digits of these primes. - M. F. Hasler, Sep 15 2015

Examples

			A260871(1) = A[2](2), therefore a(1) = 2.
A260871(2) = A[3](3), therefore a(2) = 3.
A260871(3) = A[2](4), therefore a(3) = 4.
		

Crossrefs

Cf. A173427, A260853 - A260859, A173426, A260861 - A260866 and A260860 for A[b] with b=2, ..., b=16 and b=60.
See also A260852 = { primes of the form A260851(b) = A[b](b), b in A260343 }.

Programs

  • PARI
    A261171_list(LIM=1e499)={my(A=List(),p,d);for(b=2,9e9,for(n=b,9e9,if(LIMb)));ispseudoprime(p)&&listput(A,[log(p),n])));apply(t->t[2],vecsort(A))}

Formula

A260871(n) = A[A261172(n)](a(n)), where A[b](k) = Sum_{i=1..#d} d[i]*b^(#d-i), d = concatenation of (1, 2, ..., k, k-1, ..., 1) all written in base b.

A261172 Value of b for which A260871(n) = A[b](k), with k = A261171(n); A[b](k) = the number whose base-b representation is the concatenation of the base-b representations of (1, ..., k, k-1, ..., 1).

Original entry on oeis.org

2, 3, 2, 4, 3, 6, 9, 10, 11, 16, 12, 14, 22, 18, 25, 20, 2, 6, 18, 14, 7, 40, 31, 25, 23, 20, 22, 62, 65, 68, 29, 23, 38, 26, 104, 6, 34, 52
Offset: 1

Views

Author

M. F. Hasler, Aug 23 2015

Keywords

Comments

For more data, see the 2nd column of D. Broadhurst's list of [n, b, k, length(A260871(n))] given in A260871.

Examples

			A260871(1) = A[2](2), therefore a(1) = 2.
A260871(2) = A[3](3), therefore a(2) = 3.
A260871(3) = A[2](4), therefore a(3) = 2.
		

Crossrefs

Cf. A173427, A260853 - A260859, A173426, A260861 - A260866 and A260860 for A[b] with b=2, ..., b=16 and b=60.
See also A260852 = { primes of the form A260851(b) = A[b](b), b in A260343 }.

Programs

  • PARI
    A261172_list(LIM=1e499)={my(A=List(),p,d);for(b=2,9e9,for(n=b,9e9,if(LIMb)));ispseudoprime(p)&&listput(A,[log(p),n])));apply(t->t[2],vecsort(A))}

Formula

A260871(n) = A[a(n)](A261171(n)), where A[b](k) = Sum_{i=1..#d} d[i]*b^(#d-i), d = concatenation of (1, 2, ..., k, k-1, ..., 1) all written in base b.

A261170 Number of decimal digits of A260871(n), where A260871 lists primes whose base-b representation is the concatenation of the base-b representations of (1, 2, ..., k, k-1, ..., 1).

Original entry on oeis.org

2, 3, 4, 5, 7, 9, 17, 20, 31, 38, 43, 64, 64, 70, 91, 93, 102, 117, 120, 123, 127, 127, 127, 136, 160, 166, 176, 235, 321, 351, 353, 389, 403, 418, 418, 421, 422, 466, 542, 578, 579, 703, 706, 725, 731, 765, 780, 792, 795, 799, 803, 839, 840, 848, 849, 863
Offset: 1

Views

Author

M. F. Hasler, Sep 15 2015

Keywords

Comments

Larger values based on computations by D. Broadhurst, cf. data file in A260871.
See A261171 and A261172 for the k- and b-values such that A260871(n) = A[b](k), where the sequences A[b] of numbers whose base-b representation is the concatenation of the base-b representations of (1, 2, ..., k, k-1, ..., 1) are listed in A173427, A260853 - A260859, A173426, A260861 - A260866 and A260860 for bases b=2, ..., b=16 and b=60.
Showing 1-6 of 6 results.