cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A212875 Primonacci numbers: composite numbers that appear in the Fibonacci-like sequence generated by their own prime factors.

This page as a plain text file.
%I A212875 #25 May 22 2025 10:21:35
%S A212875 4,9,12,25,27,169,1102,7921,22287,54289,103823,777627,876897,2550409,
%T A212875 20854593,34652571,144237401,144342653,167901581,267911895,792504416,
%U A212875 821223649,1103528482,2040412557,2852002829,3493254541,6033671841,15658859018,116085000401
%N A212875 Primonacci numbers: composite numbers that appear in the Fibonacci-like sequence generated by their own prime factors.
%C A212875 Given n, form a sequence that starts with the k prime factors of n in ascending order. After that, each term is the sum of the preceding k terms. If n eventually appears in the sequence, it is a primonacci number. Primes possess this property trivially and are therefore excluded.
%C A212875 Similar to A007629 (repfigit or Keith numbers), but base-independent. If n is in A005478 (Fibonacci primes), then n^2 is a primonacci number.
%C A212875 The only  entries that are semiprimes (A001358) are the squares of A005478. - _Robert Israel_, Mar 08 2016
%H A212875 Herman Beeksma, <a href="/A212875/b212875.txt">Table of n, a(n) for n = 1..42</a>
%e A212875 Fibonacci-like sequences for selected values of n:
%e A212875 n=12: 2, 2, 3, 7, 12, ...
%e A212875 n=25: 5, 5, 10, 15, 25, ...
%e A212875 n=1102: 2, 19, 29, 50, 98, 177, 325, 600, 1102, ...
%p A212875 with(numtheory): P:=proc(q,h) local a,b,j,k,n,t,v; v:=array(1..h);
%p A212875 for n from 2 to q do if not isprime(n) then b:=ifactors(n)[2]; a:=[];
%p A212875 for k from 1 to nops(b) do for j from 1 to b[k][2] do a:=[op(a),b[k][1]]; od; od; a:=sort([op(a)]);
%p A212875 b:=nops(a);  for k from 1 to b do v[k]:=a[k]; od; t:=b+1; v[t]:=add(v[k], k=1..b);
%p A212875 while v[t]<n do t:=t+1; v[t]:=add(v[k], k=t-b..t-1); od;
%p A212875 if v[t]=n then print(n); fi; fi; od; end: P(10^12,1000); # _Paolo P. Lava_, Mar 08 2016
%t A212875 PrimonacciQ[n_]:=Module[{k,seq},
%t A212875   seq=FactorInteger[n];
%t A212875   seq=Map[Table[#[[1]],{#[[2]]}]&, seq];
%t A212875   seq=Flatten[seq];
%t A212875   k=Length[seq];
%t A212875   If[k==1,Return[False]];
%t A212875   seq=Append[seq,Apply[Plus,seq]];
%t A212875   While[seq[[-1]]<n,seq=Append[seq,2*seq[[-1]]-seq[[-k-1]]]];
%t A212875   Return[seq[[-1]]==n]]; Select[Range[10000], PrimonacciQ]
%t A212875 Select[Range[10^6], Function[n, And[MemberQ[Union@ Flatten@ NestWhileList[Take[Append[#, Total@ #], -Length@ #] &, #, Last@ # <= n &, 1, 60] &[Flatten[Table[#1, {#2}] & @@@ FactorInteger@ n]], n],  CompositeQ@ n]]@ # &] (* _Michael De Vlieger_, Mar 08 2016 *)
%o A212875 (Python)
%o A212875 from sympy import isprime, factorint
%o A212875 from itertools import chain
%o A212875 A212875_list = []
%o A212875 for n in range(2,10**6):
%o A212875     if not isprime(n):
%o A212875         x = sorted(chain.from_iterable([p]*e for p,e in factorint(n).items()))
%o A212875         y = sum(x)
%o A212875         while y < n:
%o A212875             x, y = x[1:]+[y], 2*y-x[0]
%o A212875         if y == n:
%o A212875             A212875_list.append(n) # _Chai Wah Wu_, Sep 12 2014
%Y A212875 Cf. A000045, A001358, A005478, A007629.
%K A212875 nonn
%O A212875 1,1
%A A212875 _Herman Beeksma_, May 29 2012