login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A255361
Number of ways n can be represented as x*y+x+y where x>=y>1.
7
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, 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, 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
OFFSET
0,24
LINKS
FORMULA
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
EXAMPLE
8 = 2*2 + 2 + 2, this is the only representation, so a(8)=1.
23 = 2*7 + 2 + 7 = 3*5 + 3 + 5, two representations, so a(23)=2.
MATHEMATICA
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]);
Table[a[n], {n, 0, 105}] (* Jean-François Alcover, Jan 23 2018 *)
PROG
(Python)
TOP = 1000
a = [0]*TOP
for y in range(2, TOP//2):
for x in range(y, TOP//2):
k = x*y + x + y
if k>=TOP: break
a[k]+=1
print(a)
(Python)
from sympy import divisor_count
def A255361(n): return int((divisor_count(n+1)-1>>1)-(n&1)) if n!=1 else 0 # Chai Wah Wu, Oct 15 2024
(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
CROSSREFS
Sequence in context: A295343 A025915 A081285 * A341685 A069844 A233006
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Feb 21 2015
EXTENSIONS
More terms from Antti Karttunen, Sep 22 2017
STATUS
approved