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.

Previous Showing 11-17 of 17 results.

A300650 Number of orderless same-trees of weight 2n + 1 in which all outdegrees are odd and all leaves greater than 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 3, 1, 2, 6, 1, 1, 3, 3, 1, 3, 1, 1, 19, 1, 2, 3, 1, 3, 3, 1, 1, 21, 3, 1, 3, 1, 1, 28, 3, 1, 68, 1, 3, 3, 1, 3, 3, 3, 1, 25, 1, 1, 71, 1, 1, 3, 1, 3, 27, 3, 2, 3, 8, 1, 3, 1, 3, 1656, 1, 1, 3, 3, 3, 43, 1, 1, 31, 3, 1, 3, 3, 1
Offset: 0

Views

Author

Gus Wiseman, Mar 10 2018

Keywords

Comments

An orderless same-tree of weight n > 0 is either a single node of weight n, or a finite multiset of two or more orderless same-trees whose weights are all equal and sum to n.

Examples

			The a(13) = 6 orderless same-trees: 27, (999), (99(333)), (9(333)(333)), ((333)(333)(333)), (333333333).
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[n===1,1,Sum[Binomial[a[n/d]+d-1,d],{d,Select[Rest[Divisors[n]],OddQ]}]];
    Table[a[n],{n,1,100,2}]
  • PARI
    f(n) = if (n==1, 1, sumdiv(n, d, if ((d > 1) && (d % 2), binomial(f(n/d)+d-1, d))));
    a(n) = f(2*n+1); \\ Michel Marcus, Mar 10 2018

Formula

a(1) = 1; a(n > 1) = Sum_d binomial(a(n/d) + d - 1, d) where the sum is over odd divisors of n greater than 1.

A326990 Sum of odd divisors of n that are greater than 1.

Original entry on oeis.org

0, 0, 3, 0, 5, 3, 7, 0, 12, 5, 11, 3, 13, 7, 23, 0, 17, 12, 19, 5, 31, 11, 23, 3, 30, 13, 39, 7, 29, 23, 31, 0, 47, 17, 47, 12, 37, 19, 55, 5, 41, 31, 43, 11, 77, 23, 47, 3, 56, 30, 71, 13, 53, 39, 71, 7, 79, 29, 59, 23, 61, 31, 103, 0, 83, 47, 67, 17, 95, 47, 71, 12, 73, 37, 123, 19, 95, 55, 79, 5
Offset: 1

Views

Author

Omar E. Pol, Aug 24 2019

Keywords

Comments

Also sum of nonpowers of 2 dividing n, divided the sum of powers of 2 dividing n.
a(n) = 0 iff n is a power of 2.
a(n) = n iff n is an odd prime.
First differs from A284233 at a(15).

Examples

			For n = 18 the divisors of 18 are [1, 2, 3, 6, 9, 18]. The sum of odd divisors of 18 that are greater than 1 is 3 + 9 = 12, so a(18) = 12. On the other hand, there are four divisors of 18 that are not powers of 2, they are [3, 6, 9, 18], and the sum of them is 3 + 6 + 9, 18 = 36. Also there are two divisors of 18 that are powers of 2, they are [1, 2], and the sum of them is 1 + 2 = 3. Then we have that 36/3 = 12, so a(18) = 12.
		

Crossrefs

Programs

  • Magma
    sol:=[]; m:=1; for n in [1..80] do v:=[d:d in Divisors(n)|d gt 1 and IsOdd(d)]; if #v ne 0 then sol[m]:=&+v; m:=m+1; else sol[m]:=0; m:=m+1; end if; end for; sol; // Marius A. Burtea, Aug 24 2019
  • Mathematica
    Table[Total[Select[Rest[Divisors[n]],OddQ]],{n,80}] (* Harvey P. Dale, Jan 11 2025 *)

Formula

a(n) = A000593(n) - 1.
a(n) = (A000203(n) - A038712(n))/A038712(n).
a(n) = A326988(n)/A038712(n).

A357618 a(n) = sum of lengths of partitions of more than one consecutive positive integer adding up to n.

Original entry on oeis.org

0, 0, 0, 2, 0, 2, 3, 2, 0, 5, 4, 2, 3, 2, 4, 10, 0, 2, 7, 2, 5, 11, 4, 2, 3, 7, 4, 11, 7, 2, 12, 2, 0, 11, 4, 14, 11, 2, 4, 11, 5, 2, 14, 2, 8, 25, 4, 2, 3, 9, 9, 11, 8, 2, 16, 17, 7, 11, 4, 2, 16, 2, 4, 27, 0, 17, 18, 2, 8, 11, 16
Offset: 0

Views

Author

Daniel Vik, Oct 06 2022

Keywords

Comments

A polite number (A138591) has at least one partition of two or more consecutive positive integers that equals n. This sequence is the sum of lengths of all partitions that make a number polite.
This sequence is similar to A204217 which sums lengths of all partitions adding up to n including the partition of length 1.

Examples

			n=15 is the sum of three partitions of n with two or more consecutive positive integers: 15 = 1 + 2 + 3 + 4 + 5, 15 = 4 + 5 + 6, 15 = 7 + 8.
The sum of the lengths of these partitions is a(15) = 5 + 3 + 2 = 10.
On the other hand a(8) = 0 because there are no partitions of two or more consecutive integers adding up to 8.
		

Crossrefs

Cf. A069283 (politeness of a number), A138591 (polite numbers).
Cf. A204217.

Programs

  • Python
    def A357618(n):
      i=2;r=0
      while n//i>0:r+=(n%i==1)*i;n-=i;i+=1
      return r
    A357618_list = [A357618(n) for n in range(70)]

Formula

a(n) = A204217(n) - 1 for n >= 1, a(0) = 0.

A095808 Number of ways to write n in the form m + (m+1) + ... + (m+k-1) + (m+k) + (m+k-1) + ... + (m+1) + m with integers m>= 1, k>=1. Or, number of divisors d of 4n-1 with 0 < (d-1)^2 < 4n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 2, 0, 0, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 1, 0, 0, 3, 0, 1, 2, 0, 1, 1, 0, 0, 2, 2, 0, 1, 1, 0, 3, 0, 1, 2, 0, 1, 1, 0, 0, 3, 1, 0, 2, 1, 0, 3, 1, 0, 1, 0, 2, 2, 0, 1, 1, 1, 1, 1, 0, 0, 5, 1, 1, 1, 0, 1, 1, 1, 0, 3, 1, 0, 2, 0, 1, 3, 0, 0, 2, 1, 1, 3
Offset: 1

Views

Author

Alfred Heiligenbrunner, Jun 15 2004

Keywords

Comments

n = m + (m+1) + ... + (m+k-1) + (m+k) + (m+k-1) + ... + (m+1) + m means n = k^2 + m*(2k+1) or 4n-1 = (2k+1)*(4m+2k-1). So if 4n-1 disparts into two odd factors a*b, then k = (a-1)/2, m=(n-k^2)/(2k+1) give the solution of the origin equation. We only count solutions with k^2 < n, such that m>0. This means we are taking into account only factors a < 2n+1.
Note that a(n) = 0 if 4n-1 is prime. - Alfred Heiligenbrunner, Mar 01 2016

Examples

			a(16) = 2 because 16 = 5+6+5 and 16 = 1+2+3+4+3+2+1.
The trivial case 16=16 (k=0, m=n) is not counted. The cases m=0, e.g. 16 = 0+1+2+3+4+3+2+1+0 are not counted. The cases m<0 e.g. 16 = -4+-3+-2+-1+0+1+2+3+4+5+6+5+4+3+2+1+0+-1+-2+-3+-4 are not counted.
		

Crossrefs

Programs

  • Maple
    seq((numtheory[tau](4*n-1)-2)/2, n=1..100); # Ridouane Oudra, Jan 18 2025
  • Mathematica
    h1 = Table[count = 0; For[k = 1, k^2 < n, k++, If[Mod[n - k^2, 2k + 1] == 0, count++ ]]; count, {n, 100}] - or - h2 = Table[Length[Select[Divisors[4n - 1], ((# - 1)^2 < 4n) &]] - 1, {n, 100}]
    a[n_] := (DivisorSigma[0, 4*n-1] - 2)/2; Array[a, 100] (* Amiram Eldar, Jan 28 2025 *)
  • PARI
    a(n) = (numdiv(4*n-1) - 2)/2; \\ Amiram Eldar, Jan 28 2025

Formula

From Ridouane Oudra, Jan 18 2025: (Start)
a(n) = (tau(4*n-1) - 2)/2.
a(n) = A070824(4*n-1)/2.
a(n) = A078703(n) - 1. (End)
Sum_{k=1..n} a(k) = (log(n) + 2*gamma - 5 + 4*log(2))*n/4 + O(n^(1/3)*log(n)), where gamma is Euler's constant (A001620). - Amiram Eldar, Jan 27 2025

A248517 Number of odd divisors > 1 in the numbers 1 through n, counted with multiplicity.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 4, 4, 6, 7, 8, 9, 10, 11, 14, 14, 15, 17, 18, 19, 22, 23, 24, 25, 27, 28, 31, 32, 33, 36, 37, 37, 40, 41, 44, 46, 47, 48, 51, 52, 53, 56, 57, 58, 63, 64, 65, 66, 68, 70, 73, 74, 75, 78, 81, 82, 85, 86, 87, 90, 91, 92, 97, 97, 100, 103, 104, 105, 108, 111
Offset: 0

Views

Author

R. J. Mathar, Jun 18 2015

Keywords

Comments

Number of partitions of n into 3 parts such that the smallest part divides the "middle" part. - Wesley Ivan Hurt, Oct 21 2021

Crossrefs

Programs

  • Maple
    A248517 := proc(n)
        add(A069283(j),j=1..n) ;
    end proc:
  • Mathematica
    Table[Sum[Floor[Floor[i/2]/(n - i)], {i, n - 1}], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 30 2016 *)
    Join[{0},Accumulate[Table[Count[Divisors[n],?OddQ]-1,{n,80}]]] (* _Harvey P. Dale, Jan 06 2019 *)
    Join[{0}, Accumulate[Table[DivisorSigma[0, n/2^IntegerExponent[n, 2]] - 1, {n, 1, 100}]]] (* Amiram Eldar, Jul 10 2022 *)
  • PARI
    a(n)=my(n2=n\2); sum(k=1, sqrtint(n), n\k)*2-sqrtint(n)^2-sum(k=1, sqrtint(n2), n2\k)*2+sqrtint(n2)^2-n \\ Charles R Greathouse IV, Jun 18 2015
    
  • Python
    from math import isqrt
    def A248517(n): return ((t:=isqrt(m:=n>>1))+(s:=isqrt(n)))*(t-s)+(sum(n//k for k in range(1,s+1))-sum(m//k for k in range(1,t+1))<<1)-n # Chai Wah Wu, Oct 23 2023

Formula

a(n) = Sum_{j=1..n} A069283(j).
a(n) = A060831(n) - n.
a(n) = A006218(n) - A006218(floor(n/2)) - n. - Charles R Greathouse IV, Jun 18 2015
a(n) = Sum_{i=1..n-1} floor(floor(i/2)/(n-i)). - Wesley Ivan Hurt, Jan 30 2016

A272887 Number of ways to write prime(n) as (4*x + 2)*y + 4*x + 1 where x and y are nonnegative integers.

Original entry on oeis.org

0, 1, 2, 1, 2, 2, 3, 2, 2, 4, 1, 2, 4, 2, 2, 4, 4, 2, 2, 3, 2, 2, 4, 6, 3, 4, 2, 4, 4, 4, 1, 4, 4, 4, 6, 2, 2, 2, 4, 4, 6, 4, 2, 2, 6, 3, 2, 2, 4, 4, 6, 4, 3, 6, 4, 4, 8, 2, 2, 4, 2, 6, 4, 4, 2, 4, 2, 3, 4, 6, 4, 6, 2, 4, 4, 2, 8, 2, 4, 4, 8, 2, 4, 4, 4, 4, 9, 2, 8, 2, 6, 4, 2, 4, 4, 6, 8, 6, 2, 2, 2, 6, 4, 8, 4
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 16 2016

Keywords

Comments

Number of distinct values of k such that k/p_n + k divides (k/p_n)^(k/p_n) + k, (k/p_n)^k + k/p_n and k^(k/p_n) + k/p_n where p_n = prime(n) is n-th prime.
a(1) = 0, a(n+1) = number of odd divisors of 1+prime(n+1).
Conjectures:
1) a(Fermat prime(n)) >= n, i.e. a(A019434(1)=3) = 1, a(A019434(2)=5) = 2, a(A019434(3)=17) = 3, a(A019434(4)=257) = 4, a(A019434(5)=65537) = 12 > 5, ...
2) a(2^(2^n)+1) > n;
3) a(2^(2^n)+1) < a(2^(2^(n+1))+1).

Examples

			a(3) = 2 because (4*0+2)*2+4*0+1 = 5 for (x=0, y=2) and (4*1+2)*0+4*1+1 = 5 for (x=1, y=0) where 5 is the 3rd prime.
		

Crossrefs

Cf. A000215 (Fermat numbers), A001227, A000668 (Mersenne primes n such that a(n)=1), A019434 (Fermat primes), A069283, A192869 (primes n such that a(n) = 1 or 2), A206581 (primes n such that a(n)=2), A254748.

Programs

Formula

a(n+1) = A001227(A000040(n+1) + 1).

Extensions

More terms from Alois P. Heinz, May 17 2016

A316744 a(n) is the smallest number having exactly n ways to be represented as sum of at least two consecutive positive integers and expressible as sum of n consecutive positive integers, or 0 if no such number exists.

Original entry on oeis.org

9, 15, 162, 45, 729, 105, 900, 405, 9765625, 495, 1062882, 9477, 3969, 945, 344373768, 3825, 387420489, 7695, 34650, 413343, 81402749386839761113321, 7245, 202500, 732421875, 38025, 25515, 919973073089479921953602, 58725, 0, 29295, 23619600, 473513931, 60886809, 17325, 300189270593998242
Offset: 2

Views

Author

Jianing Song, Jul 13 2018

Keywords

Comments

a(n) is the smallest number such that A069283(n) == n*(n-1)/2 == A142150(n) (mod n). Or equivalently, a(n) is the smallest number of the form 2^t*s, where s is an odd number with exactly n + 1 divisors and divisible by A000265(n), t = 0 for odd n and A007814(n) - 1 for even n.
Let n = 2^e_0*Product_{i=1..m} p_i^e_i where p_i are odd primes; n + 1 = Product_{j=1..s} q_j where q_j are primes, then a(n) != 0 iff there is an injection f from {1,2,..,m} to {1,2,...,s} such that q_f(i) >= e_i + 1 for all 1 <= i <= m, implying s >= m. If such an injection does exist, then the number of k having exactly n ways to be represented as sum of at least two consecutive positive integers and expressible as sum of n consecutive positive integers is finite iff s = m, in which case the number of k is equal to the number of injections such that if i < j and e_i = e_j then q_f(i) <= q_f(j).
If A038547(n) is divisible by A000265(n), then a(n) = 2^t*A038547(n), t defined as above.
If n + 1 is a Fermat prime, then a(n) = (n/2)*3^n. If n = p - 1 = 2^e*q with p, q primes, then a(n) = 2^(e-1)*q^n, which is relatively large.

Examples

			a(2) = 9 = 4 + 5 = 2 + 3 + 4.
a(3) = 15 = 7 + 8 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5.
a(4) = 162 = 53 + 54 + 55 = 39 + 40 + 41 + 42 = 14 + 15 + 16 + ... + 22 = 8 + 9 + 10 + ... + 19.
If a number k has exactly 30 ways to be represented as sum of at least two consecutive positive integers, then it must have exactly 31 odd divisors. On the other hand, the sum of 30 consecutive positive integers is congruent to 15 mod 30, so k must be of the form p^30 where p is an odd prime, which obviously cannot be divisible by 15. So a(30) = 0.
Let n = 225 = 3^2*5^2, n + 1 = 226 = 2*113, so e_1 = 2, e_2 = 2, q_1 = 2, q_2 = 113. An injection from {1,2} to {1,2} such that q_f(1) >= e_1 + 1 and q_f(2) >= e_2 + 1 does not exist, so a(225) = 0.
		

Crossrefs

Previous Showing 11-17 of 17 results.