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 21-30 of 38 results. Next

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.

A261570 Concatenation of the palindromic numbers (A002113) in increasing order up to the n-th term and then in decreasing order.

Original entry on oeis.org

1, 121, 12321, 1234321, 123454321, 12345654321, 1234567654321, 123456787654321, 12345678987654321, 12345678911987654321, 123456789112211987654321, 1234567891122332211987654321, 12345678911223344332211987654321, 123456789112233445544332211987654321
Offset: 1

Views

Author

Robert G. Wilson v, Aug 24 2015

Keywords

Comments

By definition, all terms are palindromes. Inspired by A261493.
There are no primes in this sequence up to a(1100).
The least prime factors of a(n), n>=1, are: 1, 11, 3, 11, 41, 3, 239, 11, 3, 11, 11, 3, 11, 11, 3, 11, 11, 3, 71, 21557, 19, 17, 31, 181, 17, 353, 19, 31, 19, 29, 17, 29, 11616377, 214141, 19, 5471, 17, 13883, 3, 7, ..., . See A261411.
The first (probable) prime in this sequence was found by David Broadhurst on Aug 25 2015: this is a(2007), a 21233-digit probable prime with central term 1008001. - N. J. A. Sloane, Aug 24 2015

Examples

			a(4) is the concatenation of 1, 2, 3 and 4, and then 3, 2 and 1 which results in 1234321.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Reverse[idn = IntegerDigits@ n] == idn; s = Select[ Range @111, palQ]; f[n_] := FromDigits@ Flatten[ IntegerDigits@# & /@ Join[Take[s, n], Reverse@ Take[s, n - 1]]]; a = Array[f, 14]
  • PARI
    A002113(n)=if(n>9,(n-=9)*10+if(n>9,n\10,n),n)/* This "poor man's" version is valid only for n<109 */
    A261570(n,S=A002113(n))={while(n--,S=Str(A002113(n),S,A002113(n)));eval(S)} \\ M. F. Hasler, Aug 29 2015

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.

A359149 Concatenate the binary strings for 1,2,...,n-1, n, n-1, ..., 2,1.

Original entry on oeis.org

1, 1101, 11011101, 1101110011101, 1101110010110011101, 1101110010111010110011101, 1101110010111011111010110011101, 11011100101110111100011111010110011101, 1101110010111011110001001100011111010110011101, 110111001011101111000100110101001100011111010110011101
Offset: 1

Views

Author

N. J. A. Sloane, Feb 18 2023

Keywords

Comments

Binary analog of A173426 and A360504.
Converting these binary strings to base 10 gives A173427. E.g. 1101_2 = 13_10 gives A173427(3) = 13.
What is the first prime here if these strings are regarded as decimal numbers as they stand? a(5) = 1101110010110011101 = 3*37*53*187168113226247 is obviously not a prime.

Crossrefs

Programs

  • Maple
    a:= n-> parse(cat(map(t-> convert(t, binary), [$1..n, n-i$i=1..n-1])[])):
    seq(a(n), n=1..10);  # Alois P. Heinz, Feb 18 2023
  • Mathematica
    a[n_] := FromDigits @ Flatten @ IntegerDigits[Join[Range[1, n], Range[n - 1, 1, -1]], 2]; Array[a, 10] (* Amiram Eldar, Feb 18 2023 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        sl, sr, sk = "", "", "1"
        for k in count(1):
            sk = bin(k)[2:]
            sl += sk
            yield int(sl + sr)
            sr = sk + sr
    print(list(islice(agen(), 10))) # Michael S. Branicky, Feb 18 2023

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))
Previous Showing 21-30 of 38 results. Next