A368458 Numbers k such that 2*(Bacher(k) - sigma(k)) + k + 1 > 0.
1, 2, 4, 9, 25, 49, 121, 143, 169, 221, 289, 323, 361, 391, 437, 529, 667, 713, 841, 899, 961, 1073, 1147, 1271, 1333, 1369, 1517, 1591, 1681, 1739, 1763, 1849, 1927, 2021, 2173, 2209, 2279, 2491, 2537, 2773, 2809, 2867, 3127, 3233, 3481, 3551, 3599, 3721, 3763
Offset: 1
Keywords
Examples
To zoom into the internal order of the terms, the sequence can also be written as an irregular triangle (for n >= 3). It starts: 4; 9; 25; 49; 121, 143; 169, 221; 289, 323; 361, 391, 437; 529, 667, 713; 841, 899; 961, 1073, 1147, 1271, 1333; 1369, 1517, 1591; 1681, 1739, 1763, 1849, 1927, 2021, 2173; A row contains the terms between consecutive squares of primes, p^2 included and p'^2 excluded. The first column is the squares of primes A001248. The length of the rows is A368460.
Links
- Peter Luschny, Table of n, a(n) for n = 1..1000
- Roland Bacher, A quixotic proof of Fermat's two squares theorem for prime numbers, American Mathematical Monthly, Vol. 130, No. 9 (November 2023), 824-836; arXiv version, arXiv:2210.07657 [math.NT], 2022.
Programs
-
Julia
using Nemo function A368458List(slicenum::Int) results = [Int[] for _ in 1:slicenum + 1] slicelen = 1000 Threads.@threads for sl in 1:slicenum first = (sl - 1) * slicelen + 1 last = first + slicelen - 1 result = results[sl] for n in first:2:last rem(n, 5) == 0 && continue if 2 * (divisor_sigma(n, 1) - A368207(n)) < n + 1 push!(result, n) end end end results[slicenum + 1] = [2, 4, 25] sort(reduce(vcat, results)) end print(A368458List(5)) # returns values up to param * 1000
-
SageMath
from itertools import islice def A368207(n): def t(n): return (d for d in divisors(n) if d*d <= n) def s(d): return 2*d - 1 if d*d == n else 4*d - 2 def c(y, w, wx): return max(1, 2*((w*w < wx) + (y*y < n - wx))) return sum((sum(sum((c(y, w, wx) for y in t(n-wx) if wx < y*w), start=0) for w in t(wx)) for wx in range(1, n//2)), start=sum(s(d) for d in t(n))) def A368457(n): return 2 * (A368207(n) - sigma(n)) + n + 1 def isA368458(n): return 0 < A368457(n) def A368458Gen(n): while True: if isA368458(n): yield n n += 1 def A368458List(start, size): return list(islice(A368458Gen(start), size)) print(A368458List(1, 20))
Comments