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.

Showing 1-9 of 9 results.

A088168 Smallest number m such that A088167(m)=n.

Original entry on oeis.org

1, 3, 4, 39, 6, 15, 10, 12, 16, 22, 20, 18, 75, 38, 32, 24, 52, 44, 36, 297, 30, 575, 50, 40, 76, 399, 231, 48, 66, 615, 70, 98, 134, 88, 104, 441, 60, 80, 100, 84, 72, 108, 136, 1085, 90, 112, 96, 214, 152, 132, 585, 154, 156, 126, 174, 176, 196, 170, 186, 208
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 21 2003

Keywords

Comments

A088167(a(n))=n and A088167(k)<>n for k

A124056 a(1)=1. a(n) = number of terms from among the first (n-1) terms of the sequence which divide a(n-1).

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 4, 5, 3, 5, 4, 6, 7, 3, 6, 9, 7, 4, 7, 5, 5, 6, 10, 8, 8, 9, 8, 10, 9, 9, 10, 10, 11, 3, 7, 6, 12, 17, 3, 8, 11, 4, 8, 13, 3, 9, 14, 8, 14, 9, 15, 14, 10, 12, 21, 14, 11, 5, 7, 7, 8, 15, 16, 16, 17, 4, 9, 16, 19, 3, 10, 14, 14, 15, 18, 23, 3, 11, 6, 17, 5, 8, 17, 6, 18, 27, 19
Offset: 1

Author

Leroy Quet, Nov 03 2006

Keywords

Comments

First occurrence of k: 1, 3, 4, 6, 8, 12, 13, 24, 16, 23, 33, 37, 44, 47, 51, 63, 38, 75, 69, 101, 55, 91, 76, 132, 102, ..., . - Robert G. Wilson v, Nov 05 2006
a(n+1) = number of preceding terms that are divisors of a(n); a(1) = 1. - Reinhard Zumkeller, May 23 2013

Examples

			a(12) is 6. a(1)=1, a(2)=1, a(3)=2, a(4)=3, a(5)=3, a(9)=3 and a(12)=6 are the seven terms that divide 6. So a(13)= 7.
		

Crossrefs

Cf. A027750.
Cf. A088167 (counting divisors of n instead of those of a(n)).

Programs

  • Haskell
    import Data.List (isInfixOf)
    a124056 n = a124056_list !! (n-1)
    a124056_list = 1 : f [1] where
       f xs@(x:_) = y : f (y : xs) where
         y = length $ filter (flip elem $ a027750_row x) xs
    -- Reinhard Zumkeller, May 23 2013
  • Mathematica
    f[s_] := Append[s, Count[Mod[s[[ -1]], s], 0]]; Nest[f, {1, 1}, 86] (* Robert G. Wilson v *)
    a[1]= 1; L[1]= {1}; a[n_]:=a[n]= Sum[If[Mod[a[n - 1], L[n - 1][[i]]]==0, 1, 0], {i,1,n-1}]; L[n_]:=L[n]= Table[a[i], {i, 1, n}]; L[87] (* Joel B. Lewis, Nov 05 2006 *)

Extensions

More terms from Robert G. Wilson v and Joel B. Lewis, Nov 05 2006

A269347 With a(1) = 1, a(n) is the sum of all 0 < m < n for which a(m) divides n.

Original entry on oeis.org

1, 1, 3, 3, 3, 15, 3, 3, 30, 3, 3, 51, 3, 3, 84, 3, 3, 111, 3, 3, 150, 3, 3, 195, 3, 3, 246, 3, 3, 318, 3, 3, 366, 3, 3, 435, 3, 3, 510, 3, 3, 591, 3, 3, 684, 3, 3, 771, 3, 3, 882, 3, 3, 975, 3, 3, 1086, 3, 3, 1218, 3, 3, 1326, 3, 3, 1455
Offset: 1

Author

Alec Jones, Feb 24 2016

Keywords

Comments

For n > 2, I can prove that a(n) = 3 if 3 does not divide n, and in general, 3 divides a(n).
The base case is a(3) = 3. Suppose that the results hold for a(n) over 3 < n < k; we will show that the results hold for a(k) also. In the case that 3 does not divide k, then a(k) = 3, since a(1) and a(2) divide k but no other previous term can. This proves the first claim.
Otherwise, if 3 does divide k, then a(m) divides k for each 0 < m < k not divisible by 3; these numbers can be divided into k/3 pairs so that the sum of each pair is congruent to 0 modulo 3 (for instance, 1 + 2 == 4 + 5 == 7 + 8 == ... == 0 (mod 3)). If a(m) divides k for some 0 < m < k divisible by 3, this m does not change the congruence class of the sum that forms a(k). Thus, a(k) == 0 (mod 3) as required to prove the second claim.

Examples

			a(1) = 1;
a(2) = 1 because a(1) divides 2;
a(3) = 3 because a(1) and a(2) divide 3: 1+2=3;
a(4) = 3 because a(1) and a(2) divide 4: 1+2=3;
a(5) = 3 because a(1) and a(2) divide 5: 1+2=3;
a(6) = 15 because a(1), a(2), a(3), a(4), and a(5) divide 6: 1+2+3+4+5=15.
		

Crossrefs

Cf. A088167 which gives the number of m < n for which a(m) divides n.

Programs

  • Haskell
    a269347 1 = 1
    a269347 n = genericIndex a269347_list (n - 1)
    a269347_list = map a [1..] where
      a n = sum $ filter ((==) 0 . mod n . a269347) [1..n-1]
    -- Peter Kagey, Jun 17 2016
    
  • Java
    int[] terms = new int[1000];
    terms[0] = 1;
    for (int i = 1; i < 1000; i++) {
         int count = 0;
         for (int j = 0; j < i; j++) {
              if ((i + 1) % terms[j] == 0) {
                   count = count + (j + 1);
              }
         }
         terms[i] = count;
    }
    
  • Mathematica
    a = {1}; Do[AppendTo[a, Total@ Select[Range[n - 1], Divisible[n, a[[#]]] &]], {n, 2, 66}]; a (* Michael De Vlieger, Mar 24 2016 *)
  • PARI
    lista(nn) = {va = vector(nn); va[1] = 1; for (n=2, nn, va[n] = sum(k=1, n-1, k*((n % va[k])==0));); va;} \\ Michel Marcus, Feb 24 2016
    
  • Python
    from itertools import count, islice
    from sympy import divisors
    def A269347_gen(): # generator of terms
        A268347_dict = {1:1}
        yield 1
        for n in count(2):
            yield (s:=sum(A268347_dict.get(d,0) for d in divisors(n,generator=True)))
            A268347_dict[s] = A268347_dict.get(s,0) + n
    A269347_list = list(islice(A269347_gen(),40)) # Chai Wah Wu, Nov 17 2022
  • Ruby
    def a(n)
      seq = [1]
      (2..Float::INFINITY).each do |i|
        return seq.last[0...n].last if seq.length > n
        indices = seq.each_index.select { |j| i % seq[j] == 0 }
        seq << indices.map(&:next).reduce(:+)
      end
    end # Peter Kagey, Feb 25 2016
    

A351886 a(n) is the number of k < n such that a(k) AND n = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 2, 1, 4, 2, 3, 1, 8, 4, 6, 3, 8, 3, 4, 1, 16, 9, 11, 6, 14, 5, 8, 4, 17, 9, 10, 5, 10, 3, 5, 1, 32, 16, 21, 10, 24, 12, 15, 7, 26, 11, 17, 7, 16, 6, 11, 4, 39, 19, 20, 10, 24, 10, 11, 4, 26, 12, 15, 7, 12, 3, 6, 1, 64, 34, 34, 20, 41, 21, 21, 10, 45, 21
Offset: 0

Author

Rémy Sigrist, Feb 23 2022

Keywords

Comments

The definition is recursive: a(n) depends on prior terms (a(0), ..., a(n-1)); a(0) = 0 corresponds to an empty sum.

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  -------------------------
   0     0  {}
   1     1  {0}
   2     2  {0, 1}
   3     1  {0}
   4     4  {0, 1, 2, 3}
   5     2  {0, 2}
   6     3  {0, 1, 3}
   7     1  {0}
   8     8  {0, 1, 2, 3, 4, 5, 6, 7}
   9     4  {0, 2, 4, 5}
  10     6  {0, 1, 3, 4, 7, 9}
  11     3  {0, 4, 9}
  12     8  {0, 1, 2, 3, 5, 6, 7, 11}
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; add(
         `if`(Bits[And](n, a(j))=0, 1, 0), j=0..n-1)
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Feb 28 2022
  • PARI
    for (n=1, #a=vector(75), print1 (a[n]=sum(k=1, n-1, bitand(a[k], n-1)==0)", "))
    
  • Python
    a = []
    [a.append(sum(a[k] & n == 0 for k in range(n))) for n in range(74)]
    print(a) # Michael S. Branicky, Feb 24 2022

Formula

a(2^k) = 2^k.

A351887 a(n) is the number of k < n such that a(k) AND n = a(k) (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 2, 7, 1, 5, 2, 8, 3, 8, 6, 15, 1, 6, 3, 11, 2, 8, 7, 18, 4, 9, 8, 19, 7, 14, 14, 31, 1, 7, 4, 13, 4, 12, 10, 24, 5, 12, 9, 21, 11, 22, 19, 40, 1, 8, 5, 17, 5, 18, 13, 35, 8, 19, 15, 34, 15, 32, 28, 63, 1, 9, 4, 15, 6, 18, 12, 31, 7, 18, 11
Offset: 0

Author

Rémy Sigrist, Feb 23 2022

Keywords

Comments

The definition is recursive: a(n) depends on prior terms (a(0), ..., a(n-1)); a(0) = 0 corresponds to an empty sum.

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  ------------------------
   0     0  {}
   1     1  {0}
   2     1  {0}
   3     3  {0, 1, 2}
   4     1  {0}
   5     4  {0, 1, 2, 4}
   6     2  {0, 5}
   7     7  {0, 1, 2, 3, 4, 5, 6}
   8     1  {0}
   9     5  {0, 1, 2, 4, 8}
  10     2  {0, 6}
  11     8  {0, 1, 2, 3, 4, 6, 8, 10}
  12     3  {0, 5, 11}
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; add(
         `if`(Bits[And](n, a(j))=a(j), 1, 0), j=0..n-1)
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Feb 28 2022
  • PARI
    for (n=1, #a=vector(75), print1 (a[n]=sum(k=1, n-1, bitand(a[k], n-1)==a[k])", "))
    
  • Python
    a = []
    [a.append(sum(a[k] & n == a[k] for k in range(n))) for n in range(75)]
    print(a) # Michael S. Branicky, Feb 24 2022

A271774 a(1) = 1, then a(n) is the maximum of all 0 < m < n for which a(m) divides n.

Original entry on oeis.org

1, 1, 2, 3, 2, 5, 2, 7, 4, 7, 2, 11, 2, 13, 6, 13, 2, 17, 2, 19, 10, 19, 2, 23, 6, 23, 4, 27, 2, 29, 2, 31, 12, 31, 10, 33, 2, 37, 16, 37, 2, 41, 2, 43, 6, 43, 2, 47, 10, 49, 18, 47, 2, 53, 12, 53, 22, 53, 2, 59, 2, 61, 10, 61, 16, 61, 2, 67, 26, 67, 2, 71, 2
Offset: 1

Author

Peter Kagey, Apr 14 2016

Keywords

Comments

If n is an odd prime, then a(n) = 2 and a(n+1) = n. All n for which a(n) = 2 are odd primes. - Robert Israel, Apr 14 2016

Examples

			a(1) = 1 by definition.
a(2) = 1 because a(1) divides 2.
a(3) = 2 because a(2) divides 3.
a(4) = 3 because a(3) divides 4.
a(5) = 2 because a(2) divides 5.
a(6) = 5 because a(5) divides 6.
a(7) = 2 because a(2) divides 7.
a(8) = 7 because a(7) divides 8.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) option remember; local m;
        for m from n-1 by -1 do
          if n mod A(m) = 0 then return m fi
        od
    end proc:
    A(1):= 1:
    seq(A(i),i=1..100); # Robert Israel, Apr 14 2016
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{m = n - 1}, While[Mod[n, a[m]] > 0, m--]; m]; Array[a, 100] (* Giovanni Resta, Apr 14 2016 *)

A102128 a(1) = 1; a(n) = sum of previous terms which divide n.

Original entry on oeis.org

1, 1, 2, 4, 2, 6, 2, 12, 2, 10, 2, 34, 2, 14, 2, 20, 2, 24, 2, 54, 2, 22, 2, 70, 2, 26, 2, 46, 2, 46, 2, 36, 2, 68, 2, 94, 2, 38, 2, 74, 2, 62, 2, 70, 2, 138, 2, 94, 2, 60, 2, 82, 2, 114, 2, 74, 2, 58, 2, 172, 2, 124, 2, 68, 2, 94, 2, 242, 2, 234, 2, 154, 2, 222, 2, 118, 2, 110, 2, 114, 2
Offset: 1

Author

Leroy Quet, Feb 14 2005

Keywords

Examples

			Among the first 7 terms, the terms which divide 8 are 1, 1, 2, 4, 2 and 2.
So a(8) = 1 + 1 + 2 + 4 + 2 + 2 = 12.
		

Crossrefs

Cf. A088167.

Programs

  • Mathematica
    Nest[Function[{a, n}, Append[a, Total@ Select[a, Mod[n, #] == 0 &]]] @@ {#, Length@ # + 1} &, {1}, 80] (* Michael De Vlieger, Nov 13 2018 *)
  • PARI
    up_to = 20000;
    A102128list(up_to) = { my(v=vector(up_to)); v[1] = 1; for(n=2,up_to,v[n] = sum(j=1,n-1,v[j]*!(n%v[j]))); (v); };
    v102128 = A102128list(up_to);
    A102128(n) = v102128[n]; \\ Antti Karttunen, Nov 10 2018

Formula

a(1) = 1; a(n) = [x^n] Sum_{k=1..n-1} a(k)*x^a(k)/(1 - x^a(k)). - Ilya Gutkovskiy, Dec 11 2017

Extensions

More terms from John W. Layman, Mar 16 2005

A115751 a(1)=1. a(n) = number of positive divisors of n which are not among the first (n-1) terms of the sequence.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 4, 1, 2, 3, 2, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 2, 3, 1, 5, 1, 3, 2, 2, 2, 5, 1, 2, 2, 4, 1, 5, 1, 3, 3, 2, 1, 6, 2, 3, 2, 3, 1, 4, 2, 5, 2, 2, 1, 6, 1, 2, 4, 4, 2, 4, 1, 3, 2, 5, 1, 7, 1, 2, 3, 3, 2, 4, 1, 6, 3, 2, 1, 6, 2, 2, 2, 5, 1, 7, 2, 3, 2, 2, 2, 7, 1, 3, 4, 5, 1, 4, 1, 5, 4
Offset: 1

Author

Leroy Quet, Mar 28 2006

Keywords

Comments

There are only 40 distinct values among the first 10000 terms. The records occur at positions: 1, 4, 12, 30, 48, 72, 120, 180, 240, 360, 480, 720, 840, 1260, 1680, 2160, 2520, 4620, 5040, ... - Antti Karttunen, Oct 21 2017

Examples

			The divisors of 12 are 1, 2, 3, 4, 6 and 12. Of these, only the four divisors 3, 4, 6 and 12 do not occur among the first 11 terms of the sequence. So a(12) = 4.
		

Crossrefs

Cf. A088167.

Programs

  • Maple
    with(numtheory): a[1]:=1: for n from 2 to 120 do div:=divisors(n): M:=convert([seq(a[j],j=1..n-1)],set): a[n]:=nops(div minus M): od: seq(a[n],n=1..120); # Emeric Deutsch, Apr 01 2006
  • Scheme
    ;; We define a mutual recurrence with the memoization-macro definec:
    (definec (A115751 n) (if (= 1 n) n (length (remove (lambda (d) (zero? (modulo (Aauxseq_forA115751 (- n 1)) (A000040 d)))) (divisors n)))))
    ;; The other member of the mutual recurrence has not been submitted. Its n-th term keeps track in its prime factorization what distinct values has so far occurred in A115751(1) .. A115751(n). That is, iff value k has occurred in range a(1) .. a(n), then the n-th term of this auxiliary sequence is divisible by the k-th prime:
    (definec (Aauxseq_forA115751 n) (if (= 1 n) 2 (lcm (A000040 (A115751 n)) (Aauxseq_forA115751 (- n 1)))))
    (define (divisors n) (cons 1 (proper-divisors n)))
    (define (proper-divisors n) (let loop ((k n) (divs (list))) (cond ((= 1 k) divs) ((zero? (modulo n k)) (loop (- k 1) (cons k divs))) (else (loop (- k 1) divs)))))
    ;; Antti Karttunen, Oct 21 2017

Extensions

More terms from Emeric Deutsch, Apr 01 2006

A297003 a(n) = 2^(n-1), n=1,2,3; for n >= 4, a(n) is the number of the previous terms dividing n.

Original entry on oeis.org

1, 2, 4, 3, 1, 4, 2, 6, 3, 4, 2, 11, 2, 6, 4, 10, 2, 11, 2, 13, 4, 10, 2, 18, 2, 11, 4, 16, 2, 17, 2, 19, 7, 13, 3, 24, 2, 14, 7, 21, 2, 23, 2, 24, 5, 16, 2, 31, 4, 19, 6, 25, 2, 24, 6, 27, 7, 17, 2, 35, 2, 20, 9, 28, 5, 29, 2, 29, 6, 29, 2, 41, 2, 22, 8, 31
Offset: 1

Author

Vladimir Shevelev, Dec 23 2017

Keywords

Examples

			1-3) a(1)=1, a(2)=2 a(3)=4 by the definition;
4) Let n=4. From the previous terms {1,2,4} everyone divides 4, so a(4)=3;
5) Let n=5. From the previous terms {1,2,4,3} only 1 divides 5. So a(5)=1;
6) Let n=6. From the previous terms {1,2,4,3,1} exactly four divide 6. So a(6)=4; etc.
		

Crossrefs

Cf. A088167.

Programs

  • Mathematica
    first[n_] := Fold[Append[#1, Count[#1, k_ /; Divisible[#2, k]]] &,
      2^Range[0, Min[n - 1, 2]], Range[4, n]] (* Michael De Vlieger, Dec 23 2017 *)
  • PARI
    first(n) = my(res = vector(n), c = 0); for(x = 1, min(n, 3), res[x] = 1<<(x-1)); for(x=4, n, for(k=1, x-1, if(x%res[k]==0, c++)); res[x] = c; c = 0); res \\ Iain Fox, Dec 23 2017
    
  • Sage
    def A297003_list(leng):
        L = [1, 2, 4]
        if leng < 4: return L[0:leng]
        for n in (4..leng) :
            count = 0
            for l in L: count += int(l.divides(n))
            L.append(count)
        return L
    print(A297003_list(76)) # Peter Luschny, Dec 24 2017

Formula

a(p) = 2, where p is prime, other than 3 and 5.

Extensions

More terms from Peter J. C. Moses, Dec 23 2017
Showing 1-9 of 9 results.