login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 14

%I #31 Sep 08 2022 08:46:13

%S 1,13,439,27961,3034961,522134761,131870760799,45954960939217,

%T 21107054541321649,12345678910987654321,8954302429379707945271,

%U 7883984846509322664831433,8281481197999449959084458465,10228838696316240496325238416281,14674825961700306151086890240104831

%N 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).

%C 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.

%C 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.

%H N. J. A. Sloane, <a href="/A260851/b260851.txt">Table of n, a(n) for n = 1..100</a>

%F 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.

%F 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

%e a(1) = 1 is the "concatenation" of (1) which is the unary representation of 1, cf A000042.

%e a(2) = 13 = 1101[2] = concatenation of (1, 10, 1), where 10 is the base 2 representation of 2.

%e a(3) = 439 = 121021[3] = concatenation of (1, 2, 10, 2, 1), where 10 is the base 3 representation of 3.

%e a(10) = 12345678910987654321 is the concatenation of (1, 2, 3, ..., 9, 10, 9, 8, ..., 2, 1); it is also a prime.

%p f:=proc(b) local i;

%p add((i+1)*b^i, i=0..b-2) + b^b + add(i*b^(2*b-i),i=1..b-1); end;

%p [seq(f(b),b=1..25)]; # _N. J. A. Sloane_, Sep 26 2015

%t 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 *)

%o (PARI) A260851(n)=(1+n*r=if(n>2,n^n\(n-1),n*2-1))*(r-n+1)-1

%o (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

%o (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

%Y Cf. A173427, A260853 - A260859, A173426, A260861 - A260866, A260860.

%Y For primes in this sequence see A260343, A260852.

%K nonn,base

%O 1,2

%A _M. F. Hasler_, Aug 01 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 13:24 EDT 2024. Contains 371955 sequences. (Running on oeis4.)