login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249148 a(1) = 1, after which, if a(n-1) = 1, a(n) = 1 + the total number of 1's that have occurred in the sequence so far, otherwise a(n) = the total number of times the least prime dividing a(n-1) [i.e., A020639(a(n-1))] occurs as a divisor (counted with multiplicity for each term) in the previous terms from a(1) up to and including a(n-1). 6

%I #17 Oct 25 2014 14:49:29

%S 1,2,1,3,1,4,3,2,4,6,7,1,5,1,6,8,11,1,7,2,12,14,15,6,16,20,22,23,1,8,

%T 26,27,10,28,30,31,1,9,13,2,32,37,1,10,38,39,14,40,43,1,11,3,15,16,47,

%U 1,12,49,7,8,52,54,55,9,22,56,59,1,13,5,10,60,62,63,25,14,64,70,71,1,14,72,75,28,77,15,29,1,15,30,78,79,1,16,83

%N a(1) = 1, after which, if a(n-1) = 1, a(n) = 1 + the total number of 1's that have occurred in the sequence so far, otherwise a(n) = the total number of times the least prime dividing a(n-1) [i.e., A020639(a(n-1))] occurs as a divisor (counted with multiplicity for each term) in the previous terms from a(1) up to and including a(n-1).

%C Inspired by A248034.

%C After a(1), it is very likely that 1's occur only just after primes, although they do not necessarily occur after every prime. For example, 13 is the first prime whose initial occurrence is not followed by 1.

%H Antti Karttunen, <a href="/A249148/b249148.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 1 by definition.

%e For n = 2, we see that a(1) = 1, which is the only 1 that has occurred in the sequence so far, and thus a(2) = 1+1 = 2.

%e For n = 3, we see that a(2) = 2, with the least prime dividing it being 2, which has occurred so far only once (namely in a(2)), thus a(3) = 1.

%e For n = 4, we see that a(3) = 1, and there has occurred two 1's so far (as a(1) and a(3)), thus a(4) = 2+1 = 3.

%e For n = 5, we see that a(4) = 3, with the least prime dividing it being 3, which has occurred now just once, thus a(5) = 1.

%e For n = 6, we see that a(5) = 1, and there has occurred three 1's so far (as a(1), a(3) and a(5)), thus a(6) = 3+1 = 4.

%e For n = 7, we see that a(6) = 4 = 2*2, with its least prime 2 dividing it two times, and also occurring once at a(2), thus a(7) = 3.

%o (PARI)

%o A049084(n) = if(isprime(n), primepi(n), 0); \\ This function from _Charles R Greathouse IV_

%o A249148_write_bfile(up_to_n) = { my(pfcounts, n, a_n, f, k); pfcounts = vector(up_to_n); a_n = 1; for(n = 1, up_to_n, if((1 == a_n), pfcounts[1]++; a_n = pfcounts[1], f=factor(a_n); for(i=1,#f~,k = A049084(f[i,1])+1; pfcounts[k] += f[i,2]); a_n = pfcounts[A049084(f[1,1])+1]); write("b249148.txt", n, " ", a_n)); };

%o A249148_write_bfile(10000);

%o (MIT/GNU Scheme with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library and factor function from Aubrey Jaffer's SLIB-library)

%o (definec (A249148 n) (if (= 1 n) 1 (vector-ref (A249148aux_primefactor_counts (- n 1)) (A055396 (A249148 (- n 1))))))

%o (definec (A249148aux_primefactor_counts n) (cond ((= 1 n) (vector 2)) (else (let* ((a_n (A249148 n)) (copy-of-prevec (vector-copy (A249148aux_primefactor_counts (- n 1)))) (newsize (max (vector-length copy-of-prevec) (+ 1 (A061395 a_n)))) (pf_counts_vec (vector-grow copy-of-prevec newsize))) (let loop ((pf_indices (map A049084 (factor a_n)))) (cond ((null? pf_indices) pf_counts_vec) (else (vector-set! pf_counts_vec (car pf_indices) (+ 1 (or (vector-ref pf_counts_vec (car pf_indices)) 0))) (loop (cdr pf_indices)))))))))

%Y Cf. A020639, A049084, A055396, A061395, A249147, A248034, A249144, A249069, A249070.

%K nonn

%O 1,2

%A _Antti Karttunen_, Oct 24 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 14 15:35 EDT 2024. Contains 374322 sequences. (Running on oeis4.)