A020332 Numbers whose base-4 representation is the juxtaposition of two identical strings.
5, 10, 15, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 1040, 1105, 1170, 1235, 1300, 1365, 1430, 1495, 1560, 1625, 1690, 1755, 1820, 1885, 1950, 2015, 2080, 2145, 2210, 2275, 2340, 2405, 2470, 2535, 2600, 2665, 2730, 2795, 2860, 2925, 2990
Offset: 1
Examples
102_10 = 1212_4. - _Jon E. Schoenfield_, Feb 11 2021
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_] := n + n*4^Floor[Log[4, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *) b4jQ[n_]:=Module[{idn4=IntegerDigits[n,4],len},len=Length[idn4];EvenQ[len] && Take[ idn4,len/2]==Take[idn4,-len/2]]; Select[Range[3000],b4jQ] (* or *) Table[If[ #[[1]] == 0,Nothing,FromDigits[#,4]]&/@(Flatten[Join[{#,#}]]&/@Tuples[ {0,1,2,3},n]),{n,3}]//Flatten(* Harvey P. Dale, Sep 02 2022 *)
Formula
a(n) = n*4^floor(log_4(n)+1) + n. - Ilya Gutkovskiy, Jan 26 2018
Comments