login
A380130
For n >= 2, let b(n) = 1 if A379784(n) is 3 mod 4, 0 if A379784(n) is 1 mod 4; form the RUNS transform of {b(n), n >= 2}.
0
1, 6, 13, 34, 87, 229, 581, 1591, 4268, 11637, 31944, 88526, 246105, 688982, 1936129, 5463517, 15470445
OFFSET
1,2
EXAMPLE
A379784 begins 1, 5, 3, 7, 11, 19, 23, 31, 13, 17, 29, 37, ..., and the {b(n), n >= 2} sequence begins 0, 1, 1, 1, 1, 1, 1, 0, ..., whose RUNS transform is 1, 6, ...
MATHEMATICA
nn = 2^19; c[_] := True; q = 0; j = r = 1; s = 4;
Monitor[Rest@ Reap[Do[m = j + s;
While[Set[k, SelectFirst[FactorInteger[m][[All, 1]], c]];
! IntegerQ[k], m += s];
c[k] = False; j = k;
If[# == r, q++, r = #; Sow[q]; q = 1] &[(Mod[k, 4] - 1)/2],
{n, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Jan 13 2025 *)
PROG
(Python)
from sympy import primefactors
prev_a379784 = 1
prev_b = -1
b_run = 0
a379784_set = set([prev_a379784])
seq = []
max_seq_len = 17
while len(seq) < max_seq_len:
c = prev_a379784
done = False
while not done:
c = c + 4
factors = primefactors(c)
for factor in factors:
if factor not in a379784_set:
a379784_set.add(factor)
if factor % 4 == 3:
b = 1
else:
b = 0
if prev_b >= 0:
if b == prev_b:
b_run += 1
else:
seq.append(b_run)
b_run = 1
else:
b_run = 1
prev_b = b
prev_a379784 = factor
done = True
break
print(seq)
CROSSREFS
See also A379652, A379785.
Sequence in context: A048693 A041068 A300430 * A300634 A301356 A037243
KEYWORD
nonn,more
AUTHOR
Robert C. Lyons, Jan 12 2025
STATUS
approved