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.

Original entry on oeis.org

4, 9, 12, 25, 27, 169, 1102, 7921, 22287, 54289, 103823, 777627, 876897, 2550409, 20854593, 34652571, 144237401, 144342653, 167901581, 267911895, 792504416, 821223649, 1103528482, 2040412557, 2852002829, 3493254541, 6033671841, 15658859018, 116085000401
Offset: 1

Views

Author

Herman Beeksma, May 29 2012

Keywords

Comments

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.
Similar to A007629 (repfigit or Keith numbers), but base-independent. If n is in A005478 (Fibonacci primes), then n^2 is a primonacci number.
The only entries that are semiprimes (A001358) are the squares of A005478. - Robert Israel, Mar 08 2016

Examples

			Fibonacci-like sequences for selected values of n:
n=12: 2, 2, 3, 7, 12, ...
n=25: 5, 5, 10, 15, 25, ...
n=1102: 2, 19, 29, 50, 98, 177, 325, 600, 1102, ...
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q,h) local a,b,j,k,n,t,v; v:=array(1..h);
    for n from 2 to q do if not isprime(n) then b:=ifactors(n)[2]; a:=[];
    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)]);
    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);
    while v[t]Paolo P. Lava, Mar 08 2016
  • Mathematica
    PrimonacciQ[n_]:=Module[{k,seq},
      seq=FactorInteger[n];
      seq=Map[Table[#[[1]],{#[[2]]}]&, seq];
      seq=Flatten[seq];
      k=Length[seq];
      If[k==1,Return[False]];
      seq=Append[seq,Apply[Plus,seq]];
      While[seq[[-1]]Michael De Vlieger, Mar 08 2016 *)
  • Python
    from sympy import isprime, factorint
    from itertools import chain
    A212875_list = []
    for n in range(2,10**6):
        if not isprime(n):
            x = sorted(chain.from_iterable([p]*e for p,e in factorint(n).items()))
            y = sum(x)
            while y < n:
                x, y = x[1:]+[y], 2*y-x[0]
            if y == n:
                A212875_list.append(n) # Chai Wah Wu, Sep 12 2014