%I #53 Feb 16 2025 08:33:21
%S 1,2,4,8,9,11,15,16,18,22,23,25,29,30,32,36,37,39,43,44,46,49,50,51,
%T 53,57,58,60,64,65,67,71,72,74,78,79,81,85,86,88,92,93,95,98,99,100,
%U 102,106,107,109,113,114,116,120,121,123,127,128,130,134,135,137,141,142,144,148,149
%N Values of n such that numbers of the form x^2+n*y^2 for some integers x, y cannot have prime factor of 7 raised to an odd power.
%C Equivalently, numbers of the form 49^n*(7m+1), 49^n*(7m+2), or 49^n*(7m+4). [Corrected by _Charles R Greathouse IV_, Jan 12 2017]
%C From _Peter Munn_, Feb 08 2024: (Start)
%C Numbers whose squarefree part is congruent to a (nonzero) quadratic residue modulo 7.
%C The integers in a subgroup of the positive rationals under multiplication. As such the sequence is closed under multiplication and - where the result is an integer - under division. The subgroup has index 4 and is generated by the primes congruent to a quadratic residue (1, 2 or 4) modulo 7, the square of 7, and 3 times the other primes; that is a generator corresponding to each prime: 2, 3*3, 3*5, 7^2, 11, 3*13, 3*17, 3*19, 23, 29, 3*31, ... .
%C (End)
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquarefreePart.html">Squarefree Part</a>.
%F a(n) = 16n/7 + O(log n). - _Charles R Greathouse IV_, Jan 12 2017
%o (PARI) is(n)=n/=49^valuation(n, 49); n%7==1||n%7==2||n%7==4 \\ _Charles R Greathouse IV_ and _V. Raman_, Dec 19 2013
%o (PARI) is_A233999(n)=bittest(22,n/49^valuation(n, 49)%7) \\ - _M. F. Hasler_, Jan 02 2014
%o (PARI) list(lim)=my(v=List(),t,u); forstep(k=1,lim\=1,[1,2,4], listput(v,k)); for(e=1,logint(lim,49), u=49^e; for(i=1,#v, t=u*v[i]; if(t>lim, break); listput(v,t))); Set(v) \\ _Charles R Greathouse IV_, Jan 12 2017
%o (Python)
%o from sympy import integer_log
%o def A233999(n):
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o kmin = kmax >> 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o def f(x):
%o c = n+x
%o for i in range(integer_log(x,49)[0]+1):
%o m = x//49**i
%o c -= (m-1)//7+(m-2)//7+(m-4)//7+3
%o return c
%o return bisection(f,n,n) # _Chai Wah Wu_, Feb 14 2025
%Y Cf. A055046, A233998.
%Y Numbers whose squarefree part is congruent to a coprime quadratic residue modulo k: A003159 (k=2), A055047 (k=3), A277549 (k=4), A352272 (k=6), A234000 (k=8), A334832 (k=24).
%Y First differs from A047350 by including 49.
%K nonn,easy,changed
%O 1,2
%A _V. Raman_, Dec 18 2013