OFFSET
1,2
COMMENTS
The hyper-lucky numbers are a generalization of the lucky numbers obtained by replacing the strike-out numbers by the strike-out sets of numbers whose length is successively 1, 2, 3, ...
First, as a brief review, the algorithm for generating lucky numbers consists of the following steps:
First step: write out all the odd numbers: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, ...
Second step: the first odd number greater than 1 is 3, so strike out every third number from the list; the survivors are 1, 3, 7, 9, 13, 15, 19, ...
Third step: the first odd number greater than 3 in the list is 7, so strike out every seventh number; the survivors are 1, 3, 7, 9, 13, 15, 21, 25, 31, ...
Fourth step: the first odd number greater than 7 in the list is 9, so strike out every ninth number; the survivors are 1, 3, 7, 9, 13, 15, 21, 25, 31, ...; etc.
After this procedure has been carried out completely, the numbers remaining are called lucky numbers. The first few are 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, ... (A000959).
A similar algorithm may be employed for the development of a generalization of the lucky numbers (the hyper-lucky numbers) by the following process:
First step: write out all the odd numbers: 1, 3, 5, 7, 9, 11, 13, 15, 17, ...
Second step: the first odd number greater than 1 is 3, so strike out every set of two numbers with the period 3 from the list by elimination of the sets {5, 7}, {11, 13}, {17, 19} ...; the survivors are 1, 3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, ...
Third step: the first odd number greater than 3 in the list is 9, so strike out every set of three numbers with the period 9 from the list by elimination of the sets {45, 51, 57}, {99, 105, 111}, {153, 159, 165} ...; the survivors are 1, 3, 9, 15, 21, 27, 33, 39, 63, 69, 75, ...
After this procedure has been carried out completely, the numbers remaining are called hyper-lucky numbers. The first numbers are 1, 3, 9, 15, 21, 27, 33, 39, 63, 69, 75, ...
Property of this sequence: for a(n) > 1, a(n) == 0 (mod 3) and a(n)/3 = 1, 3, 5, 7, 9, 11, 13, 21, 23, 25, 27, 29, 31, 47, 49, ...; of these, the prime numbers are 3, 5, 7, 11, 13, 23, 29, 31, 47, 59, 61, 97, 101, 103, 139, 149, ...
MAPLE
it:=7:nn:=2000:lst :={} :lst1:={}: lst2:={}:
for i from 0 to 10*nn do:
lst:=lst union {2*i+1}:
od:
for n from 1 to it do:
mm :=nn-(n+1)*floor(nn/ lst[n+1]):
for j from 0 to mm do:
for jj from 0 to n do:
m:= lst[n+1]+j*lst[n+1]+ jj: m1:=lst[m]:lst1 :=lst1 union {m1} :
od:
od:
lst:=lst minus lst1: d:=nops(lst):lst1:={}: nn :=mm :
od:
for a from 1 to nn do: m2:=lst[a]:if m2 < 1400 then
lst2 :=lst2 union {m2} :
else fi:
od:
print(lst2):
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Feb 27 2013
EXTENSIONS
Edited by Jon E. Schoenfield, Jun 04 2017
STATUS
approved