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

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

Original entry on oeis.org

0, 1, 289, 74529, 19088161, 4886709025, 1250999747361, 320255971115809, 81985529178309409, 20988295478809805601, 5373003642721911784225, 1375488932539155041567521, 352125166730061220638180129, 90144042682896272963324429089, 23076874926821455486290258903841
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=16, 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) = (16+1)^2 = 16^2 + 2*16 + 1 = 121_16, concatenation of (1, 2, 1).
a(17) = 123456789abcdef101110fedcba987654321_16 is the concatenation of (1, 2, 3, ..., 9, a, ..., f, 10, 11, 10, f, e, ..., 1), where the middle "10, 11, 10" are the base-16 representations of 16, 17, 16.
		

Crossrefs

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

Programs

  • PARI
    a(n,b=16)=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 = 16, 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.

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)}

A007907 Concatenation of sequence (1, 2, ..., floor((n-1)/2), floor(n/2), floor(n/2)-1, ..., 1) for n >= 1.

Original entry on oeis.org

1, 11, 121, 1221, 12321, 123321, 1234321, 12344321, 123454321, 1234554321, 12345654321, 123456654321, 1234567654321, 12345677654321, 123456787654321, 1234567887654321, 12345678987654321
Offset: 1

Views

Author

R. Muller

Keywords

Comments

For n < 4900, a(2) = A259937(1) = 11, a(19) = A173426(10) = 12345678910987654321, a(20) = A259937(10) = 1234567891010987654321 and a(4891) = A173426(2446) = 1234567..244524462445..7654321 are primes (see A173426 and A259937). - XU Pingya, May 19 2017

References

  • M. Le, The Primes in the Smarandache Symmetric Sequences, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 174-175.

Crossrefs

Programs

  • Mathematica
    Table[FromDigits@ Flatten@ Map[IntegerDigits, Apply[Join, {#, If[OddQ@ n, Rest@ #, #] &@ Reverse@ #}]] &@ Range@ Ceiling[n/2], {n, 17}] (* Michael De Vlieger, May 20 2017 *)

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

Original entry on oeis.org

0, 1, 100, 8281, 672400, 54479161, 4412944900, 357449732641, 28953439105600, 21107054541321649, 138483384602892402628, 908589486379899193778809, 5961255620138564686107812272, 39111798123729126657669459066697, 256612507489786800304910707633347364
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

The base 9 is listed in A260343, because a(9) = A260851(9) = 21107054541321649 = 123456781087654321_9 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) = 100 = (9+1)^2 = 9^2 + 2*9 + 1 = 121_9, concatenation of (1, 2, 1).
a(10) = 1234567810111087654321_9 is the concatenation of (1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1), where the middle "10, 11, 10" are the base-9 representations of 9, 10, 9.
		

Crossrefs

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

Programs

  • PARI
    a(n,b=9)=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 = 9, 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.

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

Original entry on oeis.org

0, 1, 3721, 13402921, 48250954921, 173703464074921, 625332472251274921, 2251196900199483274921, 8104308840723833403274921, 29175511826606141868603274921, 105031842575782131223980603274921, 378114633272815673636150700603274921
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*c + (c - b)*(1 + b*c), is prime, where A_b is the base-b sequence, as here with b=60, and c = R(b,b) = (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) = (60+1)^2 = 60^2 + 2*60 + 1 = 121_60, concatenation of (1, 2, 1).
a(61) = 123...101110...21_60, which is the concatenation of (1, 2, 3, ..., 10, 11, 10, ..., 2, 1), where the middle "10, 11, 10" are the base-60 representations of 60, 61, 60.
		

Crossrefs

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

Programs

  • PARI
    a(n,b=60)=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 = 60, 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.

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

Original entry on oeis.org

0, 1, 144, 17689, 2143296, 259371025, 31384248336, 3797497946089, 459497294348544, 55599173087763361, 6727499948806851600, 8954302429379707945271, 131099941868210323821706774, 1919434248892467772593071038679, 28102436838034620750856132266604106
Offset: 0

Views

Author

M. F. Hasler, Aug 01 2015

Keywords

Comments

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

Examples

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

Crossrefs

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

Programs

  • PARI
    a(n,b=11)=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 = 11, we have a(n) = R(b,n)^2, where R(b,n) = (b^n-1)/(b-1) are the base-b repunits.

A077186 Smallest multiple of prime(n) of the form 123...(k-1) k (k-1)...321 ( a concatenation of natural numbers from 1 to k and back to 1), or 0 if no such number exists.

Original entry on oeis.org

0, 12321, 0, 12345654321, 121, 12345654321
Offset: 1

Views

Author

Amarnath Murthy, Nov 01 2002

Keywords

Comments

a(7) has 435 digits (k=109) and is too large to include, a(8) has 399 digits (k=103), k(a(10))=1006, k(a(11))=17, k(a(12))=3 so a(12)=12321, k(a(13))=5 so a(13)=123454321, k(a(14))=103, k(a(17))=1019, k(a(18))=1002, k(a(19))=1001, k(a(20))=16. - R. J. Mathar, May 06 2006

Crossrefs

Programs

  • PARI
    palid(n)= { local(resul) ; resul=concat("",n) ; forstep(i=n-1,1,-1, resul=concat(i,resul) ; resul=concat(resul,i) ; ) ; return(eval(resul)) ; }
    A077186(n)= { local(p) ; if(n==1 || n==3, return(0) ; ) ; p=prime(n) ; for(i=1,1500, if( palid(i)%p ==0, return(i) ; break ; ) ; ) ; return(-1) ; }
    for(n=1,20, print("n=",n," k=",A077186(n)) ; ) ;  \\ R. J. Mathar, May 06 2006

Extensions

More terms from R. J. Mathar, May 06 2006

A110759 a(n) = tau(N), where N = concatenation 1,2,3,...,n,...,3,2,1. E.g., for n = 4, N = 1234321.

Original entry on oeis.org

1, 3, 9, 9, 9, 243, 9, 81, 45, 2, 4, 18, 8, 64, 96, 16, 24, 48, 64, 4, 48, 8, 16, 384, 4, 64, 640, 4, 16, 768, 16, 512, 144, 64, 64, 448, 8, 48, 192, 16, 64, 96, 8, 64, 896, 128, 64, 192, 128, 128, 384, 32, 64, 1280, 16, 64, 192, 16, 24, 192, 32, 16
Offset: 1

Views

Author

Amarnath Murthy, Aug 11 2005

Keywords

Comments

First 9 terms are odd as corresponding N are perfect squares.
Factorization of the larger N values:
f(25) = 989931671244066864878631629*p53
f(26) = 7*3209*17627*1322221*554840431325362973971*p48
f(27) = 3^4*7*223*28807*108727*5439394515032275997*361855463775135800641*p34
f(28) = 149*p89
f(29) = 7*317310923*296879723071339*p72
f(30) = 3^2*7*167*761*133337*431911*273884231501*4950715302671*p58
f(31) = 827*1141296551*10940622359204560200188943089306257*p58
f(32) = 7*31*5537737*42583813*62231909*19871693507*1441602757913*15884064847039967*p44
f(33) = 3^2*7^2*281*743580875118413*177233764237488717892587862569137279765057*p50
f(34) = 197*509*17780359481*34117699655579*22315348168833851*p70
f(35) = 7*10243*73778819*217751506979*815234955828637451*p78

Examples

			a(3) = tau(12321) = 9.
		

Crossrefs

Programs

  • Maple
    A055642 := proc(n) 1+floor(log10(n)) ; end; A000005 := proc(n) numtheory[tau](n) ; end ; rep := proc(n) local a ; a := 1 ; for i from 2 to n do a := a*10^A055642(i)+i ; end; for i from n-1 to 1 by -1 do a := a*10^A055642(i)+i ; end; RETURN(a) ; end; A110759 := proc(n) A000005(rep(n)) ; end; for n from 1 to 50 do printf("%d %d ",n,A110759(n)) ; od ; # R. J. Mathar, Feb 10 2007
  • Mathematica
    Table[DivisorSigma[0,FromDigits[Join[Flatten[IntegerDigits/@Range[n]], Flatten[ IntegerDigits/@ Range[n-1,1,-1]]]]],{n,40}] (* Harvey P. Dale, Nov 17 2017 *)

Formula

a(n) = A000005(A173426(n)). - Georg Fischer, Feb 28 2023

Extensions

More terms from R. J. Mathar, Feb 10 2007
a(21)-a(35) from Robert Gerbicz, Nov 27 2010
a(36)-a(44) from Jinyuan Wang, May 17 2020
a(45)-a(58) from Tyler Busby, Feb 13 2023
a(59)-a(62) from Tyler Busby, Mar 04 2025
Previous Showing 11-20 of 38 results. Next