OFFSET
1,1
COMMENTS
Complement of A045572. - Reinhard Zumkeller, Nov 15 2009
Numbers that cannot be prefixed by a single digit to form a prime in decimal representation: A124665 is a subsequence. - Reinhard Zumkeller, Oct 22 2011
Up to 198, this is almost identical to "a(n) = n such that 3^n-1 is not squarefree", with the only exceptions being 39 and 117, which are not in this sequence. Why is that? - Felix Fröhlich, Oct 19 2014
The asymptotic density of this sequence is 3/5. - Amiram Eldar, Mar 09 2021
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-1).
FORMULA
G.f.: x*(2*x^4+x^2+2) / ((x-1)^2*(x^2-x+1)*(x^2+x+1)). - Colin Barker, Jul 18 2013
a(n) = 10*floor(n/6)+s(n mod 6)-floor(((n-1)mod 6)/5), where s(n) = n+1+floor((n+1)/3). - Gary Detlefs, Oct 05 2013
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/5 + log(phi)/sqrt(5), where phi is the golden ratio (A001622). - Amiram Eldar, Dec 28 2021
MAPLE
A065502 := proc(n)
option remember;
if n = 1 then
2;
else
for a from procname(n-1)+1 do
if (a mod 2) =0 or (a mod 5) =0 then
return a;
end if;
end do:
end if;
end proc; # R. J. Mathar, Jul 20 2012
MATHEMATICA
Select[Range[114], Mod[#, 2] == 0 || Mod[#, 5] == 0 &] (* T. D. Noe, Jul 13 2012 *)
Select[ Range@ 114, MemberQ[{0, 2, 4, 5, 6, 8}, Mod[#, 10]] &] (* Robert G. Wilson v, May 22 2014 *)
PROG
(PARI) { n=0; for (m=1, 10^9, if (m%2 == 0 || m%5 == 0, write("b065502.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 20 2009
(PARI) isok(m) = ! ((m%2) && (m%5)); \\ Michel Marcus, Mar 09 2021
(Haskell)
a065502 n = a065502_list !! (n-1)
a065502_list = filter ((> 1) . (gcd 10)) [1..]
-- Reinhard Zumkeller, Oct 22 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Len Smiley, Nov 25 2001
EXTENSIONS
Offset changed from 0 to 1 by Harry J. Smith, Oct 20 2009
STATUS
approved