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!)
A064394 Numbers k such that the exponent of highest power of 2 dividing k! equals the largest prime < k. 4
4, 5, 8, 9, 22, 23, 26, 27, 32, 33, 50, 51, 56, 57, 70, 71, 76, 77, 82, 83, 94, 95, 100, 101, 112, 113, 118, 119, 128, 129, 134, 135, 176, 177, 186, 187, 196, 197, 266, 267, 274, 275, 280, 281, 296, 297, 342, 343, 352, 353, 358, 359, 364, 365, 372, 373, 386, 387 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
[k/2]+[k/4]+[k/8]+[k/16]+... = prevprime(k).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1001 terms from Harvey P. Dale)
FORMULA
A011371(a(n)) = A151799(a(n)).
EXAMPLE
8! = 2^7*3^2*5*7, 23! = 2^19*3^9*5^4*7^3*11^2*13*17*19*23.
MAPLE
for n from 3 to 10^3 do if sum(floor(n/(2^i)), i=1..15) = prevprime(n) then printf(`%d, `, n) fi; od:
# second Maple program:
b:= proc(n) option remember;
`if`(n<1, 0, b(n-1)+padic[ordp](n, 2))
end:
a:= proc(n) option remember; local k; for k from 1+
`if`(n=1, 2, a(n-1)) while b(k)<>prevprime(k) do od; k
end:
seq(a(n), n=1..100); # Alois P. Heinz, Jul 10 2022
MATHEMATICA
Select[Range[400], IntegerExponent[#!, 2]==NextPrime[#, -1]&] (* Harvey P. Dale, Sep 24 2013 *)
PROG
(Python 3.10+)
from itertools import count, islice
from sympy import prevprime
def A064394_gen(startvalue=3): # generator of terms
return filter(lambda n:n-n.bit_count()==prevprime(n), count(max(startvalue, 3)))
A064394_list = list(islice(A064394_gen(), 30)) # Chai Wah Wu, Jul 10 2022
(PARI) isok(k) = (k>1) && (valuation(k!, 2) == precprime(k-1)); \\ Michel Marcus, Jul 10 2022
CROSSREFS
Sequence in context: A228012 A067271 A268128 * A346457 A141220 A340762
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Sep 29 2001
EXTENSIONS
More terms from James A. Sellers, Oct 01 2001
Name clarified and offset changed to 1 by Chai Wah Wu, Jul 10 2022
STATUS
approved

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 September 13 10:55 EDT 2024. Contains 375904 sequences. (Running on oeis4.)