OFFSET
1,2
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
FORMULA
A positive k is a term if k is a square and its odd part is divisible by exactly one prime.
MAPLE
L := (n, k) -> NumberTheory:-LegendreSymbol(n, ithprime(k)):
s := n -> local k; add(L(n, k), k = 2..n + 2):
select(m -> m = s(m), [seq(0..400)]);
# Alternative:
isA := k -> (k = 0) or (issqr(k) and
nops(NumberTheory:-PrimeFactors(k/2^padic[ordp] (k, 2))) = 1):
select(isA, [seq(0..6000)]);
MATHEMATICA
Join[{0}, Select[Range[100]^2, PrimeNu[#/2^IntegerExponent[#, 2]] == 1 &]] (* Paolo Xausa, Jul 10 2024 *)
PROG
(PARI) isok(k) = k == sum(j=2, k+2, kronecker(k, prime(j))); \\ Michel Marcus, May 22 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, May 22 2024
STATUS
approved