[go: up one dir, main page]

login
Search: a116504 -id:a116504
     Sort: relevance | references | number | modified | created      Format: long | short | data
Concatenation of numbers from n down to 1.
+10
68
1, 21, 321, 4321, 54321, 654321, 7654321, 87654321, 987654321, 10987654321, 1110987654321, 121110987654321, 13121110987654321, 1413121110987654321, 151413121110987654321, 16151413121110987654321, 1716151413121110987654321, 181716151413121110987654321
OFFSET
1,2
COMMENTS
The first prime term in this sequence is a(82) (see A176024). - Artur Jasinski, Mar 30 2008
For n < 10^4, a(n)/A000217(n) is an integer for n = 1, 2, and 18. The integers are 1, 7 (prime), and 1062667552123515268933651, respectively. - Derek Orr, Sep 04 2014
REFERENCES
F. Smarandache, "Properties of the Numbers", University of Craiova Archives, 1975; Arizona State University Special Collections, Tempe, AZ
FORMULA
a(n+1) = (n+1)*10^len(a(n)) + a(n), where len(k) = number of digits in k.
a(n) = Sum_{k=1..n} k*10^(A058183(k) - (1+floor(log10(k)))). - Alexander Goebel, Mar 07 2020
From Serge Batalov, Dec 08 2021: (Start)
a(n) = ((n*9-1)*10^n+1)/9^2 for n < 10,
a(n) = ((n*99-1)*10^(2*n-19)-89)/99^2*10^10 + (8*10^10+1)/9^2 for 10 <= n < 100,
a(n) = ((n*999-1)*10^(3*n-299)-989)/999^2*10^191 + c2 for 10^2 <= n < 10^3,
a(n) = ((n*9999-1)*10^(4*n-3999)-9989)/9999^2*10^2892 + c3 for 10^3 <= n < 10^4,
a(n) = ((n*99999-1)*10^(5*n-49999)-99989)/99999^2*10^38893 + c4 for 10^4 <= n < 10^5,
a(n) = ((n*999999-1)*10^(6*n-599999)-999989)/999999^2*10^488894 + c5 for 10^5 <= n < 10^6,
where
c2 = (98*10^191 + 879*10^10 + 121)/99^2 = a(99),
c3 = (998*10^2701 - 989)/999^2*10^191 + c2 = a(999),
c4 = (9998*10^36001 - 9989)/9999^2*10^2892 + c3 = a(9999),
c5 = (99998*10^450001 - 99989)/99999^2*10^38893 + c4 = a(99999).
(End)
MAPLE
a[1]:= 1:
for n from 2 to 100 do
a[n]:= n*10^(1+ilog10(a[n-1])) + a[n-1]
od:
seq(a[n], n=1..100); # Robert Israel, Sep 05 2014
# second Maple program:
a:= proc(n) a(n):= `if`(n=1, 1, parse(cat(n, a(n-1)))) end:
seq(a(n), n=1..22); # Alois P. Heinz, Jan 12 2021
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[PrependTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, p], {n, 1, 30}]; b (* Artur Jasinski, Mar 30 2008 *)
Table[FromDigits[Flatten[IntegerDigits/@Range[n, 1, -1]]], {n, 20}] (* Harvey P. Dale, Jul 06 2019 *)
PROG
(PARI) a(n)=my(t=n); forstep(k=n-1, 1, -1, t=t*10^#Str(k)+k); t \\ Charles R Greathouse IV, Jul 15 2011
(PARI) A000422(n, p=1, L=1)=sum(k=1, n, k*p*=L+(k==L&&!L*=10)) \\ M. F. Hasler, Nov 02 2016
(Python)
def a(n): return int("".join(map(str, range(n, 0, -1))))
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Dec 08 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
R. Muller
EXTENSIONS
Edited by N. J. A. Sloane, Dec 03 2021
STATUS
approved
Number of distinct prime divisors of the concatenation of 1..n.
+10
18
0, 2, 2, 2, 3, 3, 2, 4, 3, 3, 6, 4, 3, 3, 3, 3, 4, 5, 6, 6, 8, 6, 4, 5, 4, 6, 5, 5, 4, 7, 3, 5, 6, 2, 7, 5, 4, 4, 6, 8, 5, 7, 4, 4, 9, 7, 5, 7, 6, 9, 3, 3, 4, 9, 5, 4, 6, 4, 4, 6, 3, 7, 4, 9, 6, 8, 3, 7, 7, 6, 5, 5, 3, 9, 5, 4, 5, 6, 6, 7, 4, 7, 6, 3, 5, 7, 6, 5, 9, 8, 6, 6, 7, 5, 6, 5, 2, 9, 5, 9
OFFSET
1,2
COMMENTS
Dario Alpern's factorization program was used for n > 43.
EXAMPLE
123456 = 2*2*2*2*2*2*3*643, with distinct prime divisors 2, 3 and 643. Hence, a(6) = 3.
MATHEMATICA
Table[PrimeNu[FromDigits[Flatten[IntegerDigits[Range[n]]]]], {n, 30}] (* Jan Mangaldan, Jul 07 2020 *)
PROG
(PARI) {a=""; for(n=1, 43, a=concat(a, n); print1(omega(eval(a)), ", "))}
KEYWORD
nonn,base
AUTHOR
Parthasarathy Nambi, Mar 20 2006
EXTENSIONS
Edited and extended by Klaus Brockhaus, Mar 29 2006
Terms 59-100 from Sean A. Irvine, Nov 04 2009
STATUS
approved
a(n) = number of distinct prime divisors of A104759(n).
+10
18
0, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 4, 4, 2, 5, 4, 2, 3, 7, 4, 4, 3, 3, 2, 5, 3, 5, 2, 3, 6, 6, 3, 3, 5, 5, 7, 3, 3, 4, 3, 3, 4, 4, 5, 3, 5, 7, 3, 5, 6, 6, 5, 4, 5, 2, 6, 4, 6, 4, 4, 7, 6, 5, 5, 6, 9, 5, 5, 7, 5, 5, 5, 5, 6, 6, 4, 4, 4, 5, 8, 7, 6, 4, 5, 4, 4, 9
OFFSET
1,2
COMMENTS
Indices where number 1 occured in this sequence see A138790
LINKS
FORMULA
a(n) = A001221(A104759(n)). - Michel Marcus, Jun 30 2024
MATHEMATICA
lst = {}; Do[lst = Join[lst, IntegerDigits[n]], {n, 1, 50}]; Table[Length[FactorInteger[FromDigits[Reverse[lst[[Range[1, n]]]]]]], {n, 1, Length[lst]}] (* Robert Price, Mar 24 2015 *)
KEYWORD
nonn,base
AUTHOR
Artur Jasinski, Mar 30 2008
EXTENSIONS
Entire sequence corrected by Robert Price, Mar 24 2015
More terms from Sean A. Irvine, Jul 21 2024
STATUS
approved
a(1) = 1; for n > 1, a(n) = the smallest prime divisor of the number C(n) formed from the concatenation of 1,2,3,... up to n.
+10
17
1, 2, 3, 2, 3, 2, 127, 2, 3, 2, 3, 2, 113, 2, 3, 2, 3, 2, 13, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 29, 2, 3, 2, 3, 2, 71, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 23, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 10386763, 2, 3, 2, 3, 2, 397, 2, 3, 2, 3, 2, 37907, 2, 3, 2, 3, 2, 73, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 37, 2, 3, 2
OFFSET
1,2
COMMENTS
Least prime factor of A007908(n). For 1 < n <= 5000, a(n) < A007908(n), but this should fail infinitely often (assuming standard heuristics). - Charles R Greathouse IV, Apr 10 2014
From Robert Israel, Aug 28 2015: (Start)
a(n) = 2 iff n is even.
a(n) = 3 iff n == 3 or 5 (mod 6).
a(n) = 5 iff n == 25 (mod 30). (End)
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1000 (first 120 terms from Robert Israel)
EXAMPLE
a(5)= 3, 3 is the smallest prime divisor of 12345.
MAPLE
C:= 1: A[1]:= 1:
for n from 2 to 100 do
C:= C*10^(1+ilog10(n))+n;
F:= map(t -> t[1], ifactors(C, 'easy')[2]);
if hastype(F, integer) then A[n]:= min(select(type, F, integer))
else A[n]:= min(numtheory:-factorset(C))
fi
od:
seq(A[n], n=1..100); # Robert Israel, Aug 28 2015
MATHEMATICA
a = {}; b = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[k]]], {k, Length[w]}]; p = FromDigits[a]; AppendTo[b, First[First[FactorInteger[ p]]]], {n, 25}]; b (* Artur Jasinski, Apr 04 2008 *)
PROG
(PARI) lpf(n)=forprime(p=2, 1e3, if(n%p==0, return(p))); factor(n)[1, 1]
print1(N=1); for(n=2, 100, N=N*10^#Str(n)+n; print1(", "lpf(N))) \\ Charles R Greathouse IV, Apr 10 2014
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 01 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 03 2003
STATUS
approved
a(n) = indices n for which A138793(n) is prime.
+10
17
OFFSET
1,1
COMMENTS
Indices where number 1 occured in A138789.
There are no more primes for n<=5000.
a(3) > 20000. - Robert Price, Mar 24 2015
EXAMPLE
a(1) = 61 because the number 160695...654321 is prime.
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[k]]], {k, 1, Length[w]}]; p = FromDigits[Reverse[a]]; If[PrimeQ[p], Print[n]; AppendTo[b, p]], {n, 1, 2000}]; b (* Artur Jasinski, Mar 30 2008 *)
Select[Range[1, 1000], PrimeQ[lst = {}; Do[lst = Join[lst, IntegerDigits[n]], {n, 1, #}]; FromDigits[Reverse[lst]]] &] (* Robert Price, Mar 24 2015 *)
KEYWORD
nonn,bref,hard,more,base
AUTHOR
Artur Jasinski, Mar 30 2008, Mar 31 2008
STATUS
approved
a(n) = concatenation of reversed digits of natural numbers from n down to 1.
+10
17
1, 21, 321, 4321, 54321, 654321, 7654321, 87654321, 987654321, 1987654321, 1101987654321, 211101987654321, 31211101987654321, 4131211101987654321, 514131211101987654321, 61514131211101987654321, 7161514131211101987654321
OFFSET
1,2
COMMENTS
Note that leading zeros are not omitted when writing down digits in reversed order. So 10 reversed becomes 01. - N. J. A. Sloane, Jan 23 2017
LINKS
MAPLE
read(transforms): A138793 := proc(n) return digrev(parse(cat($(1..n)))): end: seq(A138793(n), n=1..17); # Nathaniel Johnston, Jun 26 2011
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[k]]], {k, 1, Length[w]}]; p = FromDigits[Reverse[a]]; AppendTo[b, p], {n, 1, 61}]; b (* Artur Jasinski, Mar 30 2008 *)
lst = {}; Table[FromDigits[Reverse[lst = Join[lst, IntegerDigits[n]]]], {n, 1, 15}] (* Robert Price, Mar 22 2015 *)
PROG
(Magma) [Seqint(&cat[Reverse(Intseq(k)): k in [1..n]]): n in [1..16]]; // Bruno Berselli, May 27 2011
(PARI) a(n) = my(s = ""); forstep (k=n, 1, -1, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); eval(s); \\ Michel Marcus, Jan 28 2017
KEYWORD
nonn,easy,base
AUTHOR
Artur Jasinski, Mar 30 2008, Apr 04 2008
STATUS
approved
a(1) = 1; for n>1, a(n) = the largest prime divisor of the number C(n) formed from the concatenation of 1,2,3,... up to n.
+10
10
1, 3, 41, 617, 823, 643, 9721, 14593, 3803, 1234567891, 630803, 2110805449, 869211457, 205761315168520219, 8230452606740808761, 1231026625769, 584538396786764503, 801309546900123763, 833929457045867563
OFFSET
1,2
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..56 [First 50 terms from Zak Seidov]
EXAMPLE
a(4) = 617 since 1234 = 2*617.
MATHEMATICA
a = {}; b = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[k]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, First[Last[FactorInteger[p]]]], {n, 1, 25}]; b (* Artur Jasinski, Apr 04 2008 *)
Table[FactorInteger[FromDigits[Flatten[IntegerDigits/@Range[n]]]][[-1, 1]], {n, 20}] (* Harvey P. Dale, Aug 31 2015 *)
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 01 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 03 2003
STATUS
approved
a(1) = 1; for n>1, a(n) = the smallest prime divisor of the number C(n) formed from the reverse concatenation of 1,2,3,... up to n.
+10
9
1, 3, 3, 29, 3, 3, 19, 3, 3, 7, 3, 3, 17, 3, 3, 23, 3, 3, 17, 3, 3, 13, 3, 3, 11, 3, 3, 23, 3, 3, 7, 3, 3, 89, 3, 3, 29, 3, 3, 11, 3, 3, 52433, 3, 3, 23, 3, 3, 71, 3, 3, 7, 3, 3
OFFSET
1,2
EXAMPLE
a(4)= 29, 29 is the smallest prime divisor of 4321 =29*149
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[Reverse[a]]; AppendTo[b, First[First[FactorInteger[p]]]], {n, 1, 21}]; b (* Artur Jasinski, Apr 04 2008 *)
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 01 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 03 2003
STATUS
approved
a(1) = 1; for n>1, a(n) = the largest prime divisor of the number C(n) formed from the concatenation of n, n-1, n-2, n-3, ... down to 1.
+10
8
1, 7, 107, 149, 953, 218107, 402859, 4877, 379721, 54421, 370329218107, 5767189888301, 237927839, 1728836281, 136133374970881, 1190788477118549, 677181889, 399048049, 40617114482123, 629639170774346584751, 2605975408790409767, 65372140114441
OFFSET
1,2
LINKS
FORMULA
a(n) = A006530(A000422(n)). - Daniel Suteu, May 26 2022
EXAMPLE
a(4)= 149 as 149 is the largest prime divisor of 4321 =29*149
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[Reverse[a]]; AppendTo[b, First[Last[FactorInteger[p]]]], {n, 1, 21}]; b (* Artur Jasinski, Apr 04 2008 *)
Table[FactorInteger[FromDigits[Flatten[IntegerDigits/@Range[n, 1, -1]]]] [[-1, 1]], {n, 20}] (* Harvey P. Dale, Dec 14 2020 *)
PROG
(PARI) a(n) = if(n==1, 1, vecmax(factor(eval(concat(apply(k->Str(n-k+1), [1..n]))))[, 1])); \\ Daniel Suteu, May 26 2022
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 01 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 03 2003
Name edited by Felix Fröhlich, May 26 2022
STATUS
approved
Concatenation of the reversed digits of numbers from 1 to n.
+10
7
1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678901, 1234567890111, 123456789011121, 12345678901112131, 1234567890111213141, 123456789011121314151, 12345678901112131415161
OFFSET
1,2
COMMENTS
There are no primes in this sequence for n<=7000
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, p], {n, 1, 21}]; b
(* or *)
Table[FromDigits[Flatten[Reverse/@IntegerDigits[Range[n]]]], {n, 20}] (* Harvey P. Dale, Oct 22 2013 *)
KEYWORD
nonn,base
AUTHOR
Artur Jasinski, Apr 04 2008, Apr 05 2008
STATUS
approved

Search completed in 0.014 seconds