OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = (10^(k+1) + 2)*(n + (10^k-1)*5/9) where k=floor(log(n*9/4)/log(10)). - Andrew Howroyd, Sep 27 2024
EXAMPLE
1020 is in the sequence because 20 = 2*10.
MATHEMATICA
s={}; Do[id=IntegerDigits[n]; d=Length[id] ; If[EvenQ[d]&&FromDigits[Drop[id, d/2]]==2FromDigits[Drop[id, -d/2]], AppendTo[s, n]], {n, 10, 4896}]; s (* James C. McMahon, Sep 27 2024 *)
PROG
(Python)
from itertools import count, islice, takewhile
def agen():
for d in count(2, 2):
t = (int(str(k) + str(2*k)) for k in count(10**(d//2-1)))
yield from takewhile(lambda x: x < 10**d, t)
print(list(islice(agen(), 43))) # Michael S. Branicky, Dec 24 2021
(PARI) a(n)={my(k=10^logint(n*9\4, 10)); (10*k + 2)*(n + (k-1)*5/9)} \\ Andrew Howroyd, Sep 27 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), Apr 26 2006
STATUS
approved