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.

Previous Showing 11-20 of 21 results. Next

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.

A360504 Concatenate the ternary strings for 1,2,...,n-1, n, n-1, ..., 2,1.

Original entry on oeis.org

1, 121, 121021, 1210111021, 12101112111021, 121011122012111021, 1210111220212012111021, 12101112202122212012111021, 1210111220212210022212012111021, 1210111220212210010110022212012111021, 1210111220212210010110210110022212012111021, 1210111220212210010110211010210110022212012111021
Offset: 1

Views

Author

N. J. A. Sloane, Feb 17 2023

Keywords

Comments

If the terms are read as ternary strings and converted to base 10, we get A260853. For example, a(3) = 121021_3 = 439_10, which is A260853(3). This is a prime. What is the next prime term?
If the terms are read as decimal numbers, which of them are primes? a(3) = 121021_10 is a decimal prime, but what is the next one? It is a surprise that 121021 is a prime in both base 3 and base 10.

Examples

			To get a(3) we concatenate 1, 2, 10, 2, and 1, getting 121021.
		

Crossrefs

This is the ternary analog of A173426.

Programs

  • Maple
    t:= n-> (l-> parse(cat(seq(l[-i], i=1..nops(l)))))(convert(n, base, 3)):
    a:= n-> parse(cat(map(t, [$1..n, n-i$i=1..n-1])[])):
    seq(a(n), n=1..12);  # Alois P. Heinz, Feb 17 2023
  • Mathematica
    Table[FromDigits[Flatten[Join[IntegerDigits[#,3]&/@Range[n],IntegerDigits[#,3]&/@ Range[ n-1,1,-1]]]],{n,20}] (* Harvey P. Dale, Oct 01 2023 *)
  • Python
    from sympy.ntheory import digits
    def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in list(range(1, n+1))+list(range(n-1, 0, -1))))
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Feb 18 2023
    
  • Python
    # faster version for initial segment of sequence
    from sympy.ntheory import digits
    from itertools import count, islice
    def agen(): # generator of terms
        sf, sr = "", ""
        for n in count(1):
            sn = "".join(map(str, digits(n, 3)[1:]))
            sf += sn
            yield int(sf + sr)
            sr = sn + sr
    print(list(islice(agen(), 15))) # Michael S. Branicky, Feb 18 2023

A260854 Base-4 representation of a(n) is the concatenation of the base-4 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 25, 441, 27961, 7148857, 1830131001, 468514084153, 119939614479673, 30704541449950521, 7860362613477971257, 2012252829087011018041, 515136724246861226808633, 131875001407205856562222393, 33760000360244849399916500281, 8642560092222683848298425324857
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

The base 4 is listed in A260343, which means that a(4) = A260851(4) = 27961 is prime and therefore in A260852. See these sequences for more information.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = 25 = 16 + 2*4 + 1 = 121_4 is the concatenation of (1, 2, 1).
a(4) = 27961 = 12310321_4 is the concatenation of (1, 2, 3, 10, 3, 2, 1), where the middle "10" is the base-4 representation of 4.
		

Crossrefs

Base-4 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases b = 3, ..., 16.

Programs

  • PARI
    a(n,b=4)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

A260864 Base-14 representation of a(n) is the concatenation of the base-14 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 225, 44521, 8732025, 1711559641, 335466848025, 65751518430361, 12887297839395225, 2525910379700086681, 495078434465717705625, 97035373155903680328601, 19018933138565843484771225, 3727710895159027432980276121, 10228838696316240496325238416281
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

See A260343 for the bases b such that A260851(b) = A_b(b) = b*r + (r - b)*(1 + b*r), is prime, where A_b is the base-b sequence, as here with b=14, and r = (b^b-1)/(b-1) is the base-b repunit of length b.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = (14+1)^2 = 14^2 + 2*14 + 1 = 121_14, concatenation of (1, 2, 1).
a(15) = 123456789abcd101110dcba987654321_14 is the concatenation of (1, 2, 3, ..., 9, a, b, c, d, 10, 11, 10, d, ..., 1), where "d, 10, 11" are the base-14 representations of 13, 14, 15.
		

Crossrefs

Base-14 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases.
For primes see A261408.

Programs

  • PARI
    a(n,b=14)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

Formula

For n < b = 14, we have a(n) = R(14,n)^2, where R(b,n) = (b^n-1)/(b-1) are the base-b repunits.

A260865 Base-15 representation of a(n) is the concatenation of the base-15 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 256, 58081, 13075456, 2942086081, 661970995456, 148943498386081, 33512287502995456, 7540264693665886081, 1696559556157202995456, 381725900136606353386081, 85888327530754964702995456, 19324873694420145086040886081
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

See A260343 for the bases b such that B(b) = A_b(b) = b*c + (c - b)*(1 + b*c), is prime, where A_b is the base-b sequence, as here with b=15, and c = R(b,b) = (b^n-1)/(b-1) is the base-b repunit of length b.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = (15+1)^2 = 15^2 + 2*15 + 1 = 121_15, concatenation of (1, 2, 1).
a(16) = 123456789abcde101110edcba987654321_15 is the concatenation of (1, 2, 3, ..., 9, a, ..., e, 10, 11, 10, e, d, ..., 1), where "e, 10, 11" are the base-15 representations of 14, 15, 16.
		

Crossrefs

Base-15 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases.

Programs

  • PARI
    a(n,b=15)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

Formula

For n < b = 15, we have a(n) = A_b(n) = R(b,n)^2, where R(b,n) = (b^n-1)/(b-1) are the base-b repunits.

A260855 Base-5 representation of a(n) is the concatenation of the base-5 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 36, 961, 24336, 3034961, 1896581836, 1185364159961, 740852620019336, 463032888020409961, 289395555025471581836, 180872221891237629784961, 113045138682031465901269336, 70653211676269864870442284961, 44158257297668670511080159081836
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

Base-5 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases b = 3, ..., 16.
The base 5 is not listed in A260343, because a(5) = A260851(5) = 3034961 is not prime and therefore not in A260852. See these sequences for more information.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = 36 = (5+1)^2 = 5^2 + 2*5 + 1 = 121_4 is the concatenation of (1, 2, 1).
a(5) = 3034961 = 1234104321_5 is the concatenation of (1, 2, 3, 4, 10, 4, 3, 2, 1), where the middle "10" is the base-5 representation of 5.
		

Programs

  • PARI
    a(n,b=5)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

A260856 Base-6 representation is the concatenation of the base-6 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 49, 1849, 67081, 2418025, 522134761, 676678989289, 876975982612969, 1136560874204496361, 1472982892995886760425, 1908985829323636470956521, 2474045634803467686907986409, 3206363142705295375772778742249, 4155446632946062852128962559066601
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = 49 = (6+1)^2 = 6^2 + 2*6 + 1 = 121_6 is the concatenation of (1, 2, 1).
a(7) = 676678989289 = 1234510111054321_6 is the concatenation of (1, 2, 3, 4, 5, 10, 11, 10, 5, 4, 3, 2, 1), where the middle "10, 11, 10" are the base 6 representations of 6, 7, 6.
		

Crossrefs

Base 6 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases b = 3, ..., 16.

Programs

  • PARI
    a(n,b=6)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

A260857 Base-7 representation of a(n) is the concatenation of the base-7 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 64, 3249, 160000, 7845601, 384473664, 131870760799, 316621469105950, 760208147660763999, 1825259762561514314050, 4382448689911580334132199, 10522259304477772232578647150, 25263944590051134455098854865399, 60658730960712773989601560650105250
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

Base-7 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases.
The base 7 is not listed in A260343, because a(7) = A260851(7) = 131870760799 = 12345610654321_7 is not prime and therefore not in A260852. See these sequences for more information.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = 64 = (7+1)^2 = 7^2 + 2*7 + 1 = 121_7 is the concatenation of (1, 2, 1).
a(8) = 316621469105950 = 123456101110654321_7 is the concatenation of (1, 2, 3, 4, 5, 6, 10, 11, 10, 6, 5, 4, 3, 2, 1), where the middle "10, 11, 10" are the base-7 representations of 7, 8, 7.
		

Programs

  • Mathematica
    Table[FromDigits[Flatten[Join[IntegerDigits[Range[n],7], IntegerDigits[ Range[ n-1,1,-1],7]]],7],{n,0,20}] (* Harvey P. Dale, Nov 02 2017 *)
  • PARI
    a(n,b=7)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

A260858 Base-8 representation of a(n) is the concatenation of the base-8 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 81, 5329, 342225, 21911761, 1402427601, 89755965649, 45954960939217, 188231512819194065, 770996276517410920657, 3158000748616424634669265, 12935171066332946781853145297, 52982460687699754593548358342865, 217016158976818195107979529799293137
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

Base-8 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases.
The base 8 is not listed in A260343, because a(8) = A260851(8) = 45954960939217 is not prime and therefore not in A260852. See these sequences for more information.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = 81 = (8+1)^2 = 8^2 + 2*8 + 1 = 121_8, the concatenation of (1, 2, 1).
a(9) = 12345671011107654321_8, concatenation of (1, 2, 3, 4, 5, 6, 7, 10, 11, 10, 7, 6, 5, 4, 3, 2, 1), where the middle "10, 11, 10" are the base-8 representations of 8, 9, 8.
		

Programs

  • PARI
    a(n,b=8)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

Formula

For n < b = 8, we have a(n) = A_b(n) = R(b,n)^2, where R(b,n) = (b^n-1)/(b-1) are the base-b repunits.

A260862 Base-12 representation of a(n) is the concatenation of the base-12 representations of 1, 2, ..., n, n-1, ..., 1.

Original entry on oeis.org

0, 1, 169, 24649, 3553225, 511709641, 73686731209, 10610895808969, 1527969074670025, 220027547690625481, 31683966878707771849, 4562491230669011577289, 7883984846509322664831433, 163482309777203435651765004745, 3389969175540090458609916107975113
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

The first prime in this sequence is a(16) = A260871(11). Since a(12) is not prime, the base 12 is not listed in A260343.

Examples

			a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = (12+1)^2 = 12^2 + 2*12 + 1 = 121_12, concatenation of (1, 2, 1).
a(13) = 123456789ab101110ba987654321_12 is the concatenation of (1, 2, 3, ..., 9, a, b, 10, 11, 10, b, ..., 1), where "b, 10, 11" are the base-12 representations of 11, 12, 13.
		

Crossrefs

Base-12 variant of A173426 (base 10) and A173427 (base 2). See A260853 - A260866 for variants in other bases.

Programs

  • PARI
    a(n,b=12)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))

Formula

For n < b = 12, we have a(n) = R(b,n)^2, where R(b,n) = (b^n-1)/(b-1) are the base-b repunits.
Previous Showing 11-20 of 21 results. Next