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.

A255361 Number of ways n can be represented as x*y+x+y where x>=y>1.

This page as a plain text file.
%I A255361 #28 Oct 16 2024 06:57:39
%S A255361 0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,1,0,1,1,0,0,2,1,0,1,1,0,2,0,1,1,0,
%T A255361 1,3,0,0,1,2,0,2,0,1,2,0,0,3,1,1,1,1,0,2,1,2,1,0,0,4,0,0,2,2,1,2,0,1,
%U A255361 1,2,0,4,0,0,2,1,1,2,0,3,2,0,0,4,1,0,1,2,0,4,1,1,1,0,1,4,0,1,2,3,0,2,0,2,3,0
%N A255361 Number of ways n can be represented as x*y+x+y where x>=y>1.
%H A255361 Antti Karttunen, <a href="/A255361/b255361.txt">Table of n, a(n) for n = 0..3300</a>
%F A255361 Let d = A000005; then a(n) = floor((d(n+1) - 1)/2) for even n and a(n) = floor((d(n+1) - 3) / 2) for odd n>1. - _Ivan Neretin_, Sep 07 2015
%e A255361 8 = 2*2 + 2 + 2, this is the only representation, so a(8)=1.
%e A255361 23 = 2*7 + 2 + 7 = 3*5 + 3 + 5, two representations, so a(23)=2.
%t A255361 a[n_] := (r = Reduce[x >= y > 1 && n == x*y + x + y, {x, y}, Integers]; Which[r[[0]] === And, 1, r[[0]] === Or, Length[r], True, 0]);
%t A255361 Table[a[n], {n, 0, 105}] (* _Jean-François Alcover_, Jan 23 2018 *)
%o A255361 (Python)
%o A255361 TOP = 1000
%o A255361 a = [0]*TOP
%o A255361 for y in range(2, TOP//2):
%o A255361     for x in range(y, TOP//2):
%o A255361         k = x*y + x + y
%o A255361         if k>=TOP: break
%o A255361         a[k]+=1
%o A255361 print(a)
%o A255361 (Python)
%o A255361 from sympy import divisor_count
%o A255361 def A255361(n): return int((divisor_count(n+1)-1>>1)-(n&1)) if n!=1 else 0 # _Chai Wah Wu_, Oct 15 2024
%o A255361 (PARI) a(n) = {nb = 0; for (y=2, n\2, for (x=y, n\2, nb += ((x*y+x+y) == n););); nb;} \\ _Michel Marcus_, Feb 22 2015
%Y A255361 Cf. A253975, A254636.
%K A255361 nonn
%O A255361 0,24
%A A255361 _Alex Ratushnyak_, Feb 21 2015
%E A255361 More terms from _Antti Karttunen_, Sep 22 2017