OFFSET
1,2
COMMENTS
Sequence A033014 consists of the numbers that have all base 16 digits repeated *exactly* twice. (This is equivalent to say that the base-256 digits are 0x00, 0x11, 0x22,... or 0xFF, in hex notation, and no two adjacent base-256 digits are equal.) Thus, these numbers are divisible by 0x11 = 17, and the result of the division is a number which has no other base-256 digits than 0x00, 0x01,... or 0x0F, and no two adjacent digits equal. Conversely, it is clear that exactly these numbers are terms of A033014 when multiplied by 17 = 0x11. - M. F. Hasler, Feb 05 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1800
FORMULA
a(n) = A033014(n)/17. [This was initially the definition of the sequence. - M. F. Hasler, Feb 03 2014]
MATHEMATICA
Select[Range[20000], Union[Length/@Split[IntegerDigits[#, 16]]]=={2}&]/17 (* Vincenzo Librandi, Feb 06 2014 *)
PROG
(PARI) is_A043320(n)={(n=[n])&&!until(!n[1], ((n=divrem(n[1], 256))[2]<16 && n[1]%16!=n[2])||return)} \\ M. F. Hasler, Feb 03 2014
(Python)
from itertools import count, islice, groupby
def A043320_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:set(len(list(g)) for k, g in groupby(hex(17*n)[2:]))=={2}, count(max(startvalue, 1)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
New definition by M. F. Hasler, Feb 03 2014
STATUS
approved