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!)
A020333 Numbers whose base-5 representation is the juxtaposition of two identical strings. 7

%I #34 Jun 12 2021 09:07:00

%S 6,12,18,24,130,156,182,208,234,260,286,312,338,364,390,416,442,468,

%T 494,520,546,572,598,624,3150,3276,3402,3528,3654,3780,3906,4032,4158,

%U 4284,4410,4536,4662,4788,4914,5040,5166,5292,5418,5544,5670,5796,5922,6048

%N Numbers whose base-5 representation is the juxtaposition of two identical strings.

%H Amiram Eldar, <a href="/A020333/b020333.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale)

%F a(n) = n*5^floor(log_5(n)+1) + n. - _Ilya Gutkovskiy_, Jan 26 2018

%e 182_10 = 1212_5. - _Jon E. Schoenfield_, Feb 11 2021

%t tis5Q[n_]:=Module[{idn=IntegerDigits[n,5],len},len=Length[idn];EvenQ[len] && Take[idn,len/2]==Take[idn,-len/2]]; Select[Range[6500],tis5Q] (* or *) Flatten[Table[FromDigits[#,5]&/@Select[(Flatten[{#,#}]&/@Tuples[ Range[ 0,4],n]),#[[1]]!=0&],{n,3}]] (* The second program is significantly faster than the first. *) (* _Harvey P. Dale_, Apr 08 2013 *)

%t a[n_] := n + n*5^Floor[Log[5, n] + 1]; Array[a, 50] (* _Amiram Eldar_, Apr 06 2021 *)

%o (Python)

%o from itertools import count, product

%o def agen():

%o for d in count(1):

%o for first in "1234":

%o for p in product("01234", repeat=d-1):

%o yield int((first+"".join(p))*2, 5)

%o g = agen()

%o print([next(g) for n in range(1, 49)]) # _Michael S. Branicky_, Jun 12 2021

%Y Cf. A020330, A020331, A020332, A020334, A020335, A020336, A020337, A020338.

%K nonn,base

%O 1,1

%A _David W. Wilson_, Melia Aldridge (ma38(AT)spruce.evansville.edu)

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 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)