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
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.
-
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
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.
-
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 *)
-
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
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.
-
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))
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
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.
-
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))
A260863
Base-13 representation of a(n) is the concatenation of the base-13 representations of 1, 2, ..., n, n-1, ..., 1.
Original entry on oeis.org
0, 1, 196, 33489, 5664400, 957345481, 161792190756, 27342890695849, 4620948663553600, 780940325907974961, 131978915101424183716, 22304436652439380447009, 3769449794266138309731600, 8281481197999449959084458465, 236527384496061684935031509169004
Offset: 0
a(0) = 0 is the result of the empty sum corresponding to 0 digits.
a(2) = (13+1)^2 = 13^2 + 2*13 + 1 = 121_13, concatenation of (1, 2, 1).
a(14) = 123456789abc101110cba987654321_13 is the concatenation of (1, 2, 3, ..., 9, a, b, c, 10, 11, 10, c, ..., 1), where "c, 10, 11" are the base-13 representations of 12, 13, 14.
-
a(n,b=13)=sum(i=1,#n=concat(vector(n*2-1,k,digits(min(k,n*2-k),b))),n[i]*b^(#n-i))
A261138
The concatenation of 123456...n and the reverse of this number.
Original entry on oeis.org
11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891001987654321, 12345678910111101987654321, 123456789101112211101987654321, 1234567891011121331211101987654321, 12345678910111213144131211101987654321
Offset: 1
For n=10 we concatenate 1,2,3,...,10,01,9,8,...3,2,1 getting 1234567891001987654321.
-
with(StringTools);
myReverse := n -> Reverse(convert(n,string));
A349804:=proc(n) local i,L,R;
L:=""; R:="";
for i from n to 1 by -1 do
L:=Join( [convert(i,string), L],"");
R:=Join( [R, myReverse(convert(i,string))],"");
od:
parse(Join([L,R],""));
end proc; # N. J. A. Sloane, Dec 01 2021
# second Maple program:
a:= n-> (s-> parse(cat(s, seq(s[-i], i=1..length(s)))))(cat("", $1..n)):
seq(a(n), n=1..14); # Alois P. Heinz, Dec 01 2021
-
Table[d = Flatten[IntegerDigits /@ Range@ n]; FromDigits@ Flatten[{d, Reverse@ d}], {n, 13}] (* Michael De Vlieger, Aug 20 2015 *)
-
def A349804(n): return int((lambda x: x+x[::-1])(''.join(str(d) for d in range(1,n+1)))) # Chai Wah Wu, Dec 01 2021
More than the usual number of terms are shown in order to distinguish this from several similar sequences.
A323532
Numbers k such that the decimal concatenation of the numbers from 1 up to k followed by digit reversals of the numbers from (k-1) down to 1 is a prime.
Original entry on oeis.org
10 is a term because 12345678910987654321 is a prime.
2219 is a term because 1...22172218221981227122...1 is a 15534-digit probable prime (where 8122 following 2219 corresponds to the digit reversal of 2218, 7122 to that of 2217, etc. down to 1).
Cf.
A173426 (similar but different concatenation scheme).
-
a[n_]:=Block[{cn=Drop[FoldList[Append, {}, ToString/@Range@n], 2]}, ParallelMap[If[PrimeQ[FromDigits@@{#<>Reverse@StringReverse@Most@#}], Length@#, Nothing]&, cn]]; a[2300]
-
f(n) = eval(concat(vector(2*n-1, k, if(k<=n, Str(k), concat(apply(x->Str(x), Vecrev(digits(2*n-k))))))));
isok(n) = ispseudoprime(f(n)); \\ Michel Marcus, Jan 20 2019
A350153
Prime numbers created by concatenating all numbers 1 through k for some k > 1, then continuing to concatenate all numbers from k-1 towards 1. Primes are added to the sequence as they are found as k increases.
Original entry on oeis.org
12343, 1234543, 12345678910987, 12345678910987654321, 12345678910111213141516171819202122212019181716151413, 12345678910111213141516171819202122232425262728293029
Offset: 1
For k=10, the first prime obtained by concatenating the numbers 1..10 and then concatenating the first one or more numbers from 9..1 is 12345678910987.
-
select(isprime, [seq(seq(parse(cat($1..n, n-i$i=1..t)),
t=0..n-1), n=1..30)])[]; # Alois P. Heinz, Dec 19 2021
-
lst={};Table[s=Flatten[IntegerDigits/@Range@n];k=n-1;
While[k!=-1,If[PrimeQ[p=FromDigits@s],AppendTo[lst,p]];s=Join[s,IntegerDigits@k];k--],{n,100}];lst (* Giorgos Kalogeropoulos, Dec 17 2021 *)
-
from itertools import count, chain, islice, accumulate
from sympy import isprime
def A350153gen(): return filter(lambda p:isprime(p),(int(s) for n in count(1) for s in accumulate(str(d) for d in chain(range(1,n+1),range(n-1,0,-1)))))
A350153_list = list(islice(A350153gen(),20)) # Chai Wah Wu, Dec 20 2021
Comments